remove unneeded array and added time for sleep between attachment downloads
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user