mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-09-04 19:55:30 +02:00
catch json parse errors in link archiving
This commit is contained in:
@@ -80,6 +80,7 @@ def archive_links(archive_path, links, source=None, resume=None):
|
||||
def archive_link(link_dir, link, overwrite=True):
|
||||
"""download the DOM, PDF, and a screenshot into a folder named after the link's timestamp"""
|
||||
|
||||
try:
|
||||
update_existing = os.path.exists(link_dir)
|
||||
if update_existing:
|
||||
link = {
|
||||
@@ -115,9 +116,11 @@ def archive_link(link_dir, link, overwrite=True):
|
||||
if FETCH_MEDIA:
|
||||
link = fetch_media(link_dir, link, overwrite=overwrite)
|
||||
|
||||
|
||||
write_link_index(link_dir, link)
|
||||
|
||||
except Exception as err:
|
||||
print(' ! Failed to archive link: {err.__class__.__name__}: {err}')
|
||||
|
||||
return link
|
||||
|
||||
def log_link_archive(link_dir, link, update_existing):
|
||||
|
Reference in New Issue
Block a user