chg: Avoid exception on broken captures

pull/483/head
Raphaël Vinot 2022-08-04 21:11:58 +02:00
parent 2f87a77c1b
commit 94bae7c5e3
1 changed files with 3 additions and 1 deletions

View File

@ -89,9 +89,11 @@ class AsyncCapture(AbstractManager):
with open(tmp_f.name, "wb") as f:
f.write(to_capture[b'document'])
url = f'file://{tmp_f.name}'
else:
elif to_capture.get(b'url'):
url = to_capture[b'url'].decode()
self.thirdparty_submit(url)
else:
self.logger.warning(f'Invalid capture {to_capture}.')
self.logger.info(f'Capturing {url} - {uuid}')
success, error_message = await self._capture(