diff --git a/image_preview_thumbnailer.py b/image_preview_thumbnailer.py index 0cec090..1ad98c1 100644 --- a/image_preview_thumbnailer.py +++ b/image_preview_thumbnailer.py @@ -148,7 +148,8 @@ def process_link(img_downloader, anchor_tag, url_match, config=PluginConfig()): LOGGER.info("Thumbnail does not exist for %s => downloading image from %s", thumb_filename, anchor_tag['href']) tmp_thumb_filepath = img_downloader(url_match, config) if not tmp_thumb_filepath: # => means the downloader failed to retrieve the image in a "supported" case - with open(config.fs_thumbs_dir(thumb_filename + '.none'), 'w', encoding='utf8'): + hostname = urlparse(anchor_tag['href']).netloc + with open(config.fs_thumbs_dir(thumb_filename f'{hostname}.none'), 'w', encoding='utf8'): pass return img_ext = os.path.splitext(tmp_thumb_filepath)[1]