mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
News download: Remove all <iframe> tags by default as the iPad can't handle them
This commit is contained in:
parent
282aa58029
commit
2ee2c64e9e
@ -23,14 +23,6 @@ class NewYorker(BasicNewsRecipe):
|
|||||||
category = 'news, politics, USA'
|
category = 'news, politics, USA'
|
||||||
encoding = 'cp1252'
|
encoding = 'cp1252'
|
||||||
|
|
||||||
html2lrf_options = [
|
|
||||||
'--comment', description
|
|
||||||
, '--category', category
|
|
||||||
, '--publisher', publisher
|
|
||||||
]
|
|
||||||
|
|
||||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'id':'printbody'})]
|
keep_only_tags = [dict(name='div', attrs={'id':'printbody'})]
|
||||||
remove_tags_after = dict(name='div',attrs={'id':'articlebody'})
|
remove_tags_after = dict(name='div',attrs={'id':'articlebody'})
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
|
@ -621,8 +621,9 @@ class BasicNewsRecipe(Recipe):
|
|||||||
for attr in self.remove_attributes:
|
for attr in self.remove_attributes:
|
||||||
for x in soup.findAll(attrs={attr:True}):
|
for x in soup.findAll(attrs={attr:True}):
|
||||||
del x[attr]
|
del x[attr]
|
||||||
for base in list(soup.findAll('base')):
|
for base in list(soup.findAll(['base', 'iframe'])):
|
||||||
base.extract()
|
base.extract()
|
||||||
|
|
||||||
return self.postprocess_html(soup, first_fetch)
|
return self.postprocess_html(soup, first_fetch)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user