diff --git a/application/lib/calibre/web/fetch/simple.py b/application/lib/calibre/web/fetch/simple.py index 0bf68b26..3b48bddd 100644 --- a/application/lib/calibre/web/fetch/simple.py +++ b/application/lib/calibre/web/fetch/simple.py @@ -144,6 +144,7 @@ def __init__(self, options, fs, log, job_info=None, image_map=None, css_map=None self.fs = fs fs.makedirs(self.base_dir) self.log = log + self.options = options self.verbose = options.verbose self.timeout = options.timeout or 60 self.encoding = options.encoding @@ -180,7 +181,6 @@ def __init__(self, options, fs, log, job_info=None, image_map=None, css_map=None self.scale_news_images = getattr(options, 'scale_news_images', None) self.get_delay = getattr(options, 'get_delay', None) self.download_stylesheets = not options.no_stylesheets - self.keep_images = options.keep_images self.show_progress = False self.failed_links = [] self.job_info = job_info @@ -407,7 +407,7 @@ def rescale_image(self, data, itype='jpeg'): return rescale_image(data, self.scale_news_images, self.compress_news_images_max_size, self.compress_news_images_auto_size, itype=itype) def process_images(self, soup, baseurl): - if not self.keep_images: + if not getattr(self.options, 'keep_images'): for tag in soup.find_all('img'): tag.decompose() return @@ -461,11 +461,14 @@ def process_images(self, soup, baseurl): itype = what(None, data) if itype == 'svg' or (itype is None and b'