commit 7b0d74bf55064550dffef53bc063305635b0a8f3 parent 05f4cdc547d0d395a8b3d97435a33914289cf483 Author: archiveanon <> Date: Fri, 2 Aug 2024 17:33:44 +0000 Report data on upload cancellation Diffstat:
M | src/gofile/api.py | | | 11 | +++++++++-- |
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/gofile/api.py b/src/gofile/api.py @@ -244,8 +244,15 @@ def main(): print(f"- Guest token: {first_upload.result.guest_token}") # let the rest of the uploads process - for upload in uploads: - pass + try: + for upload in uploads: + pass + except KeyboardInterrupt: + # reprint the information in case we bail out + print() + print("Cancelling upload. Resume with the following options:") + print(f"- Folder ID: {first_upload.result.parent_folder}") + print(f"- Token: {first_upload.result.guest_token or args.token}") if __name__ == "__main__":