mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-29 01:00:11 +02:00
ignore json parsing errors when loading link jsons
This commit is contained in:
@@ -96,8 +96,11 @@ def parse_json_link_details(out_dir: str) -> Optional[Link]:
|
||||
existing_index = os.path.join(out_dir, JSON_INDEX_FILENAME)
|
||||
if os.path.exists(existing_index):
|
||||
with open(existing_index, 'r', encoding='utf-8') as f:
|
||||
link_json = json.load(f)
|
||||
return Link.from_json(link_json)
|
||||
try:
|
||||
link_json = json.load(f)
|
||||
return Link.from_json(link_json)
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
return None
|
||||
|
||||
@enforce_types
|
||||
|
Reference in New Issue
Block a user