initial request can also fail, retry

This commit is contained in:
j 2023-07-29 11:08:07 +02:00
parent c045d32d2c
commit 823c017fa4

View file

@ -1118,8 +1118,17 @@ class API(ox.API):
if resume:
data = resume
else:
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()