mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Update epoch_times.recipe
This commit is contained in:
parent
d4900b902b
commit
b3b8d274a8
@ -18,19 +18,16 @@ class EpochTimes(BasicNewsRecipe):
|
|||||||
masthead_url = 'https://epochtimes-ny.newsmemory.com/eeLayout/epochtimes/1.0.a/images/webapp/banner.png'
|
masthead_url = 'https://epochtimes-ny.newsmemory.com/eeLayout/epochtimes/1.0.a/images/webapp/banner.png'
|
||||||
extra_css = """
|
extra_css = """
|
||||||
body{font-family: Arial,sans-serif }
|
body{font-family: Arial,sans-serif }
|
||||||
.featured_caption{font-size: small}
|
|
||||||
.author,.date{font-size: small}
|
|
||||||
"""
|
"""
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
classes('post-main'),
|
dict(name='article')
|
||||||
]
|
]
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
classes('print:hidden h-header'),
|
classes('print:hidden h-header shortcode aspect-square'),
|
||||||
dict(name='button'),
|
dict(name='button'),
|
||||||
]
|
]
|
||||||
#
|
|
||||||
# feeds can be found at https://www.theepochtimes.com/rssfeeds
|
|
||||||
|
|
||||||
|
# feeds can be found at https://www.theepochtimes.com/rssfeeds
|
||||||
feeds = [
|
feeds = [
|
||||||
('Special Series', 'https://feed.theepochtimes.com/health/special-series/feed'),
|
('Special Series', 'https://feed.theepochtimes.com/health/special-series/feed'),
|
||||||
('US', 'https://feed.theepochtimes.com/us/feed'),
|
('US', 'https://feed.theepochtimes.com/us/feed'),
|
||||||
@ -48,11 +45,4 @@ class EpochTimes(BasicNewsRecipe):
|
|||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for img in soup.findAll('img', attrs={'data-src': True}):
|
for img in soup.findAll('img', attrs={'data-src': True}):
|
||||||
img['src'] = img['data-src']
|
img['src'] = img['data-src']
|
||||||
title = soup.find(attrs={'class': 'post_title'})
|
|
||||||
fi = soup.find(attrs={'class': 'featured_image'})
|
|
||||||
if title is not None and fi is not None:
|
|
||||||
title.extract()
|
|
||||||
fi.insert_before(title)
|
|
||||||
for div in soup.findAll(**classes('post-main'))[1:]:
|
|
||||||
div.extract()
|
|
||||||
return soup
|
return soup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user