Skip to content

Commit

Permalink
Retry failed downloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
agibbons27 committed Apr 26, 2024
1 parent f8e03b9 commit 9e754f2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/download-test-images.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import shutil
import sys
import time

from urllib.parse import urlparse
from zipfile import ZipFile
Expand Down Expand Up @@ -88,11 +87,14 @@ def download_dftt_images():
for url in dftt_urls:
download(url)

time.sleep(15)

for filename in os.listdir("."):
_, ext = os.path.splitext(filename)
if ext == ".zip":
while os.path.getsize(filename) == 154:
for url in dftt_urls:
if filename in url:
print(f"Retrying download of {filename}")
download(url)
print(f"unzipping: {filename}")
unzip(filename)

Expand Down

0 comments on commit 9e754f2

Please sign in to comment.