From 6a2810f603c8fcd3ebbef229b93206f9661a862a Mon Sep 17 00:00:00 2001 From: Yoshihiro OKUMURA Date: Mon, 23 Dec 2024 13:58:14 +0900 Subject: [PATCH] show summary when file download fails and delete broken files. --- mdrsclient/commands/download.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mdrsclient/commands/download.py b/mdrsclient/commands/download.py index 9ca0e29..1543c9d 100644 --- a/mdrsclient/commands/download.py +++ b/mdrsclient/commands/download.py @@ -145,6 +145,9 @@ class DownloadCommand(BaseCommand): try: file_api.download(info.file, info.path) except Exception: + print(f"Failed: ${info.path}") + if os.path.isfile(info.path): + os.remove(info.path) return False print(info.path) return True