Update Reader's Digest

This commit is contained in:
Kovid Goyal 2020-08-27 09:39:35 +05:30
parent 6db4815793
commit 7bab8a1353
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2,7 +2,6 @@
__license__ = 'GPL v3'
'''
'''
import re
from calibre.web.feeds.recipes import BasicNewsRecipe
@ -56,15 +55,15 @@ class ReadersDigest(BasicNewsRecipe):
('Advice', 'http://www.rd.com/advice/feed'),
]
# cover_url = 'http://www.rd.com/images/logo-main-rd.gif'
keep_only_tags = [
classes('entry-header rd-article-dek'),
dict(name='article', attrs={'class': lambda x: x and 'post-' in x}),
classes('post-title post-author post-updated-date post-date featured-image post-body entry-title dek listicle-card')
]
remove_tags = [
dict(attrs={'class': re.compile('rd-article--sidebar.*')}),
dict(attrs={'class': ['rd-article--footer', 'rd-article--sharing']}),
dict(attrs={'id': ['newsletter-form-container',
'confirmation-msg-container']}),
classes('single-card ad brand-info pure-g')
]
def preprocess_html(self, soup):
for img in soup.findAll('img', attrs={'data-lazy-src': True}):
img['src'] = img['data-lazy-src']
return soup