diff options
author | Jesús <heckyel@hyperbola.info> | 2020-06-14 17:10:24 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-06-14 17:10:24 -0500 |
commit | 8e12f3b2da51a1287907e34ddf43e71baf60a26c (patch) | |
tree | 6018d0c505745612a43db0a3fb22ebca626f8dbe | |
parent | 6760bb2e3505240acbbf2326e47f21c5c6c6a477 (diff) | |
download | libretube-8e12f3b2da51a1287907e34ddf43e71baf60a26c.tar.lz libretube-8e12f3b2da51a1287907e34ddf43e71baf60a26c.tar.xz libretube-8e12f3b2da51a1287907e34ddf43e71baf60a26c.zip |
pep8
-rw-r--r-- | plugins/tipue-search/tipue_search.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/plugins/tipue-search/tipue_search.py b/plugins/tipue-search/tipue_search.py index 788a8b9..0f021a7 100644 --- a/plugins/tipue-search/tipue_search.py +++ b/plugins/tipue-search/tipue_search.py @@ -59,8 +59,12 @@ class Tipue_Search_JSON_Generator(object): if getattr(article, 'status', 'published') != 'published': return - soup_title = BeautifulSoup(article.title.replace(' ', ' '), 'html.parser') - video_title = soup_title.get_text(' ', strip=True).replace('“', '"').replace('”', '"').replace('’', "'").replace('^', '^') + soup_title = BeautifulSoup( + article.title.replace(' ', ' '), 'html.parser') + video_title = soup_title.get_text(' ', strip=True).replace( + '“', '"').replace( + '”', '"').replace( + '’', "'").replace('^', '^') # description art_desc = BeautifulSoup(article.content, 'html.parser') @@ -72,10 +76,16 @@ class Tipue_Search_JSON_Generator(object): art_desc = BeautifulSoup(art_desc_html, 'html.parser') video_desc_html = art_desc_html.replace('\n', ' ') except: - video_desc_html = ''.join(map(str, art_desc)).replace('\n', ' ') + video_desc_html = ''.join( + map(str, art_desc)).replace('\n', ' ') pass - video_desc_text = art_desc.get_text(' ', strip=True).replace('“', '"').replace('”', '"').replace('’', "'").replace('¶', ' ').replace('^', '^') + video_desc_text = art_desc.get_text(' ', strip=True).replace( + '“', '"').replace( + '”', '"').replace( + '’', "'").replace( + '¶', ' ').replace('^', '^') + video_desc_text = ' '.join(video_desc_text.split()) # base url |