mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'shrink_new_yorker' of https://github.com/gregallen/calibre
Fixes #2037334 [new yorker epub recipe too large to email](https://bugs.launchpad.net/calibre/+bug/2037334)
This commit is contained in:
commit
cabc458155
@ -61,6 +61,15 @@ class NewYorker(BasicNewsRecipe):
|
||||
]
|
||||
remove_attributes = ['style']
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||
if self.output_profile.short_name.startswith('kindle'):
|
||||
# Reduce image sizes to get file size below amazon's email
|
||||
# sending threshold
|
||||
self.web2disk_options.compress_news_images = True
|
||||
self.web2disk_options.compress_news_images_auto_size = 5
|
||||
self.log.warn('Kindle Output profile being used, reducing image quality to keep file size below amazon email threshold')
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for noscript in soup.findAll('noscript'):
|
||||
noscript.name = 'div'
|
||||
|
Loading…
x
Reference in New Issue
Block a user