mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Update Reader's Digest
This commit is contained in:
parent
6db4815793
commit
7bab8a1353
@ -2,7 +2,6 @@
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
'''
|
'''
|
||||||
'''
|
'''
|
||||||
import re
|
|
||||||
|
|
||||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
|
|
||||||
@ -56,15 +55,15 @@ class ReadersDigest(BasicNewsRecipe):
|
|||||||
('Advice', 'http://www.rd.com/advice/feed'),
|
('Advice', 'http://www.rd.com/advice/feed'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# cover_url = 'http://www.rd.com/images/logo-main-rd.gif'
|
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
classes('entry-header rd-article-dek'),
|
classes('post-title post-author post-updated-date post-date featured-image post-body entry-title dek listicle-card')
|
||||||
dict(name='article', attrs={'class': lambda x: x and 'post-' in x}),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(attrs={'class': re.compile('rd-article--sidebar.*')}),
|
classes('single-card ad brand-info pure-g')
|
||||||
dict(attrs={'class': ['rd-article--footer', 'rd-article--sharing']}),
|
|
||||||
dict(attrs={'id': ['newsletter-form-container',
|
|
||||||
'confirmation-msg-container']}),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for img in soup.findAll('img', attrs={'data-lazy-src': True}):
|
||||||
|
img['src'] = img['data-lazy-src']
|
||||||
|
return soup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user