From bedf89fdd238249ea2265eecf19289bb6cb92412 Mon Sep 17 00:00:00 2001 From: Austin Gibbons Date: Fri, 26 Apr 2024 16:26:36 -0400 Subject: [PATCH 1/4] Update dftt image list. --- tests/download-test-images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/download-test-images.py b/tests/download-test-images.py index 13b92b0..fb07c5d 100644 --- a/tests/download-test-images.py +++ b/tests/download-test-images.py @@ -67,7 +67,7 @@ def download_dftt_images(): "http://prdownloads.sourceforge.net/dftt/3-kwsrch-ntfs.zip?download", "http://prdownloads.sourceforge.net/dftt/4-kwsrch-ext3.zip?download", "http://prdownloads.sourceforge.net/dftt/5-fat-daylight.zip?download", - "http://prdownloads.sourceforge.net/dftt/6-undel-fat.zip?download", + #"http://prdownloads.sourceforge.net/dftt/6-undel-fat.zip?download", "http://prdownloads.sourceforge.net/dftt/7-undel-ntfs.zip?download", "http://prdownloads.sourceforge.net/dftt/8-jpeg-search.zip?download", "http://prdownloads.sourceforge.net/dftt/9-fat-label.zip?download", From d5db3f70797874bba0f3bd07eead3485b53a3ec8 Mon Sep 17 00:00:00 2001 From: Austin Gibbons Date: Fri, 26 Apr 2024 16:30:18 -0400 Subject: [PATCH 2/4] Update dftt image list. --- tests/download-test-images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/download-test-images.py b/tests/download-test-images.py index fb07c5d..b91940e 100644 --- a/tests/download-test-images.py +++ b/tests/download-test-images.py @@ -69,7 +69,7 @@ def download_dftt_images(): "http://prdownloads.sourceforge.net/dftt/5-fat-daylight.zip?download", #"http://prdownloads.sourceforge.net/dftt/6-undel-fat.zip?download", "http://prdownloads.sourceforge.net/dftt/7-undel-ntfs.zip?download", - "http://prdownloads.sourceforge.net/dftt/8-jpeg-search.zip?download", + #"http://prdownloads.sourceforge.net/dftt/8-jpeg-search.zip?download", "http://prdownloads.sourceforge.net/dftt/9-fat-label.zip?download", "http://prdownloads.sourceforge.net/dftt/10b-ntfs-autodetect.zip?download", "http://prdownloads.sourceforge.net/dftt/11-carve-fat.zip?download", From f8e03b95e751b8e7476f22d6295c9f20e2626e1f Mon Sep 17 00:00:00 2001 From: Austin Gibbons Date: Fri, 26 Apr 2024 16:53:35 -0400 Subject: [PATCH 3/4] Update download image function. --- tests/download-test-images.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/download-test-images.py b/tests/download-test-images.py index b91940e..b4eaf54 100644 --- a/tests/download-test-images.py +++ b/tests/download-test-images.py @@ -1,6 +1,7 @@ import os import shutil import sys +import time from urllib.parse import urlparse from zipfile import ZipFile @@ -67,9 +68,9 @@ def download_dftt_images(): "http://prdownloads.sourceforge.net/dftt/3-kwsrch-ntfs.zip?download", "http://prdownloads.sourceforge.net/dftt/4-kwsrch-ext3.zip?download", "http://prdownloads.sourceforge.net/dftt/5-fat-daylight.zip?download", - #"http://prdownloads.sourceforge.net/dftt/6-undel-fat.zip?download", + "http://prdownloads.sourceforge.net/dftt/6-undel-fat.zip?download", "http://prdownloads.sourceforge.net/dftt/7-undel-ntfs.zip?download", - #"http://prdownloads.sourceforge.net/dftt/8-jpeg-search.zip?download", + "http://prdownloads.sourceforge.net/dftt/8-jpeg-search.zip?download", "http://prdownloads.sourceforge.net/dftt/9-fat-label.zip?download", "http://prdownloads.sourceforge.net/dftt/10b-ntfs-autodetect.zip?download", "http://prdownloads.sourceforge.net/dftt/11-carve-fat.zip?download", @@ -87,6 +88,8 @@ 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": From 9e754f280d1a4c0f99bb8066bf3c73c8a0c58ea7 Mon Sep 17 00:00:00 2001 From: Austin Gibbons Date: Fri, 26 Apr 2024 17:15:52 -0400 Subject: [PATCH 4/4] Retry failed downloads. --- tests/download-test-images.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/download-test-images.py b/tests/download-test-images.py index b4eaf54..cabe465 100644 --- a/tests/download-test-images.py +++ b/tests/download-test-images.py @@ -1,7 +1,6 @@ import os import shutil import sys -import time from urllib.parse import urlparse from zipfile import ZipFile @@ -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)