From cb26519dd42f7ea5f43142fd91e2d8d851fa6e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 26 Dec 2023 19:47:16 +0100 Subject: [PATCH] chg: remove broken json files --- lookyloo/modules/vt.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lookyloo/modules/vt.py b/lookyloo/modules/vt.py index d3a764f..457d46b 100644 --- a/lookyloo/modules/vt.py +++ b/lookyloo/modules/vt.py @@ -47,8 +47,12 @@ class VirusTotal(AbstractModule): if not cached_entries: return None - with cached_entries[0].open() as f: - return json.load(f) + try: + with cached_entries[0].open() as f: + return json.load(f) + except json.decoder.JSONDecodeError: + cached_entries[0].unlink(missing_ok=True) + return None def capture_default_trigger(self, cache: 'CaptureCache', /, *, force: bool=False, auto_trigger: bool=False) -> Dict: '''Run the module on all the nodes up to the final redirect'''