Fix issues

This commit is contained in:
2021-03-28 19:53:14 +02:00
parent b7315c2348
commit 8eae777265
5 changed files with 22 additions and 32 deletions

View File

@@ -269,7 +269,9 @@ class HTMLDownloadHandler(DownloadHandler):
to_replace.append((url_start, url_end, local_path))
except Exception as e:
logging.error("Failed to download image: %s, skipping...", target, exc_info=e)
logging.error("Failed to download image: %s, skipping...", target)
logging.debug("", exc_info=e)
processed[target] = None
# reverse the list so urls at the bottom of the html file are processed first.
# Otherwise, our start and end positions won't be correct.
@@ -277,7 +279,7 @@ class HTMLDownloadHandler(DownloadHandler):
for (start, end, path) in to_replace:
html = html[:start] + path + html[end:]
logging.info("Saving to HTML '%s'", parser.get_relative_save_path(target_path))
logging.info("Saving HTML to '%s'", parser.get_relative_save_path(target_path))
with open(target_path, 'w', encoding=FORMAT) as file:
file.write(html)