chg: remove broken json files

pull/852/head
Raphaël Vinot 2023-12-26 19:47:16 +01:00
parent a98c1d39ee
commit cb26519dd4
1 changed files with 6 additions and 2 deletions

View File

@ -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'''