From 4ac0a2db376b1967d4388af81801cc6d95e232fe Mon Sep 17 00:00:00 2001 From: John Gaunt Date: Thu, 8 Sep 2022 20:17:31 -0400 Subject: [PATCH] remove unneeded array and added time for sleep between attachment downloads --- bitwardenBackup.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bitwardenBackup.py b/bitwardenBackup.py index bc2350f..6d6648a 100644 --- a/bitwardenBackup.py +++ b/bitwardenBackup.py @@ -11,6 +11,7 @@ import base64 import optparse import hmac as pyhmac import datetime +import time from kmip.core import enums from kmip.pie import client @@ -472,7 +473,6 @@ if __name__ == "__main__": logger.info("Looking for items with attachments") bitwarden_items = json.loads(((subprocess.run([bitwarden_cli_executable, 'list', 'items'], capture_output=True)).stdout).decode()) - bitwarden_items_with_attachments = () for item in bitwarden_items: logger.debug("Working on item {} ({})".format(item['name'], item['id'])) if "attachments" in item: @@ -481,13 +481,9 @@ if __name__ == "__main__": for attachment in item['attachments']: logger.debug("Downloading attachment ({}) with name {} to folder {}".format(attachment['id'], attachment['name'], attachment_folder_name)) logger.debug((subprocess.run([bitwarden_cli_executable, 'get', 'attachment', attachment['id'], '--itemid', item['id'], '--output', os.path.join(attachment_folder_name, attachment['filename'])], capture_output=True).stdout).decode()) - + time.sleep(1) else: logger.debug("Item has no attachments") - - - - else: logger.error("Unable to unlock vault, please check vault password") else: