mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Foreign Affairs
This commit is contained in:
parent
099cbca59c
commit
b657ba60d7
@ -164,8 +164,7 @@ class ForeignAffairsRecipe(BasicNewsRecipe):
|
|||||||
FRONTPAGE = INDEX + '/magazine'
|
FRONTPAGE = INDEX + '/magazine'
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(attrs={'class': lambda x: x and set(x.split()).intersection(
|
classes('article-header article-body'),
|
||||||
set('article-header l-article-column'.split()))}),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
conversion_options = {'comments': description, 'tags': category, 'language': 'en',
|
conversion_options = {'comments': description, 'tags': category, 'language': 'en',
|
||||||
@ -199,8 +198,9 @@ class ForeignAffairsRecipe(BasicNewsRecipe):
|
|||||||
return html.tostring(root, encoding='unicode')
|
return html.tostring(root, encoding='unicode')
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for img in soup.findAll('img', attrs={'ng-src': True}):
|
for attr in ('ng-src', 'data-blazy'):
|
||||||
img['src'] = img['ng-src']
|
for img in soup.findAll('img', attrs={attr: True}):
|
||||||
|
img['src'] = img[attr]
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
def get_browser(self):
|
def get_browser(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user