Fix issues
This commit is contained in:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user