mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2025-02-18 06:18:25 +00:00
catch json parse errors in link archiving
This commit is contained in:
parent
c37941efd1
commit
ad7038e031
1 changed files with 30 additions and 27 deletions
|
@ -80,6 +80,7 @@ def archive_links(archive_path, links, source=None, resume=None):
|
||||||
def archive_link(link_dir, link, overwrite=True):
|
def archive_link(link_dir, link, overwrite=True):
|
||||||
"""download the DOM, PDF, and a screenshot into a folder named after the link's timestamp"""
|
"""download the DOM, PDF, and a screenshot into a folder named after the link's timestamp"""
|
||||||
|
|
||||||
|
try:
|
||||||
update_existing = os.path.exists(link_dir)
|
update_existing = os.path.exists(link_dir)
|
||||||
if update_existing:
|
if update_existing:
|
||||||
link = {
|
link = {
|
||||||
|
@ -115,9 +116,11 @@ def archive_link(link_dir, link, overwrite=True):
|
||||||
if FETCH_MEDIA:
|
if FETCH_MEDIA:
|
||||||
link = fetch_media(link_dir, link, overwrite=overwrite)
|
link = fetch_media(link_dir, link, overwrite=overwrite)
|
||||||
|
|
||||||
|
|
||||||
write_link_index(link_dir, link)
|
write_link_index(link_dir, link)
|
||||||
|
|
||||||
|
except Exception as err:
|
||||||
|
print(' ! Failed to archive link: {err.__class__.__name__}: {err}')
|
||||||
|
|
||||||
return link
|
return link
|
||||||
|
|
||||||
def log_link_archive(link_dir, link, update_existing):
|
def log_link_archive(link_dir, link, update_existing):
|
||||||
|
|
Loading…
Add table
Reference in a new issue