fix: Do not fail if the meta file is missing.

pull/79/head
Raphaël Vinot 2020-06-24 11:49:10 +02:00
parent 6a12c003f0
commit f4bf64a485
1 changed files with 3 additions and 2 deletions

View File

@ -331,8 +331,9 @@ class Lookyloo():
def load_tree(self, capture_dir: Path) -> Tuple[str, str, str, str, Dict[str, str]]:
meta = {}
with open((capture_dir / 'meta'), 'r') as f:
meta = json.load(f)
if (capture_dir / 'meta').exists():
with open((capture_dir / 'meta'), 'r') as f:
meta = json.load(f)
ct = self.get_crawled_tree(capture_dir)
return ct.to_json(), ct.start_time.isoformat(), ct.user_agent, ct.root_url, meta