From 5605faa05b07aca759ea9f3fbe4e8ff91f950d94 Mon Sep 17 00:00:00 2001 From: Florian Fontan Date: Mon, 15 Apr 2024 18:40:24 +0200 Subject: [PATCH] Update download script --- scripts/download_data.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/download_data.py b/scripts/download_data.py index 5d2e237..699e7fe 100644 --- a/scripts/download_data.py +++ b/scripts/download_data.py @@ -1,12 +1,20 @@ import gdown import os import pathlib +import time def download(id): - gdown.download(id=id, output="data.7z") - os.system("7z x data.7z -odata") - pathlib.Path("data.7z").unlink() + for _ in range(3): + try: + gdown.download(id=id, output="data.7z") + os.system("7z x data.7z -odata") + pathlib.Path("data.7z").unlink() + except: + time.sleep(10) + continue + return + sys.exit(1) download("1_sbLgEoWCFo4gEsg9BE8eG4De4f8fkF0")