From f4bf64a48578bbc55047b996582b4a2c61fbe344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 24 Jun 2020 11:49:10 +0200 Subject: [PATCH] fix: Do not fail if the meta file is missing. --- lookyloo/lookyloo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index 06fa8440..65128917 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -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