From 47ecc7a4fa70d6682bbf29681d65331e932d2f38 Mon Sep 17 00:00:00 2001 From: Arhamyss Date: Tue, 19 Jul 2022 10:07:36 -0400 Subject: [PATCH] new: Download file --- bin/async_capture.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/async_capture.py b/bin/async_capture.py index ecaf1fa..631fbf9 100755 --- a/bin/async_capture.py +++ b/bin/async_capture.py @@ -183,6 +183,14 @@ class AsyncCapture(AbstractManager): with (dirpath / 'parent').open('w') as _parent: _parent.write(parent) + if 'downloaded_file_name' in entries: + with(dirpath / '0.data.file_name').open('w') as _downloaded_file_name: + _downloaded_file_name.write(entries['downloaded_file_name']) + + if 'downloaded_file' in entries: + with(dirpath / '0.data').open('wb') as _downloaded_file: + _downloaded_file.write(entries['downloaded_file'].getvalue()) + if 'error' in entries: with (dirpath / 'error.txt').open('w') as _error: json.dump(entries['error'], _error)