diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index 21b5dfc..89d3de8 100755 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -1118,8 +1118,17 @@ class API(ox.API): if resume: data = resume else: - data = self._json_request(url, data) - + data = None + while not data: + try: + data = self._json_request(url, data) + except KeyboardInterrupt: + print("\ninterrupted by user.") + sys.exit(1) + except: + print("failed to start upload, will try again in 5 seconds\r", end='') + sys.stdout.flush() + time.sleep(5) print(filename) hide_cursor()