pep8
This commit is contained in:
parent
6760bb2e35
commit
8e12f3b2da
@ -59,8 +59,12 @@ class Tipue_Search_JSON_Generator(object):
|
|||||||
if getattr(article, 'status', 'published') != 'published':
|
if getattr(article, 'status', 'published') != 'published':
|
||||||
return
|
return
|
||||||
|
|
||||||
soup_title = BeautifulSoup(article.title.replace(' ', ' '), 'html.parser')
|
soup_title = BeautifulSoup(
|
||||||
video_title = soup_title.get_text(' ', strip=True).replace('“', '"').replace('”', '"').replace('’', "'").replace('^', '^')
|
article.title.replace(' ', ' '), 'html.parser')
|
||||||
|
video_title = soup_title.get_text(' ', strip=True).replace(
|
||||||
|
'“', '"').replace(
|
||||||
|
'”', '"').replace(
|
||||||
|
'’', "'").replace('^', '^')
|
||||||
|
|
||||||
# description
|
# description
|
||||||
art_desc = BeautifulSoup(article.content, 'html.parser')
|
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')
|
art_desc = BeautifulSoup(art_desc_html, 'html.parser')
|
||||||
video_desc_html = art_desc_html.replace('\n', ' ')
|
video_desc_html = art_desc_html.replace('\n', ' ')
|
||||||
except:
|
except:
|
||||||
video_desc_html = ''.join(map(str, art_desc)).replace('\n', ' ')
|
video_desc_html = ''.join(
|
||||||
|
map(str, art_desc)).replace('\n', ' ')
|
||||||
pass
|
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())
|
video_desc_text = ' '.join(video_desc_text.split())
|
||||||
|
|
||||||
# base url
|
# base url
|
||||||
|
Loading…
x
Reference in New Issue
Block a user