mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Merge branch 'recipe-foreignaffairs-fix' of https://github.com/ping/calibre
This commit is contained in:
commit
489ecd08d3
@ -180,9 +180,8 @@ 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 attr in ('ng-src', 'data-blazy', 'data-src'):
|
for img in soup.find_all('img', attrs={'srcset': True}):
|
||||||
for img in soup.findAll('img', attrs={attr: True}):
|
img['src'] = img['srcset'].split(',')[-1].strip().split(' ')[0].strip()
|
||||||
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