From 07c712af4dd248c96346e0ed6a78c1e8307d9f47 Mon Sep 17 00:00:00 2001 From: Frederic Germain Date: Thu, 27 Jun 2019 08:19:56 +0200 Subject: [PATCH] Fix resume download by not using cache date. Do not use cache date if trying to resume download: if the "If-Modified-Since:" HTTP header is present, Apple servers ignores the Range: HTTP header. --- installinstallmacos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installinstallmacos.py b/installinstallmacos.py index 05bad4e..4209ec3 100755 --- a/installinstallmacos.py +++ b/installinstallmacos.py @@ -239,9 +239,10 @@ def replicate_url(full_url, curl_cmd = ['/usr/bin/curl', options, '--create-dirs', '-o', local_file_path] if not ignore_cache and os.path.exists(local_file_path): - curl_cmd.extend(['-z', local_file_path]) if attempt_resume: curl_cmd.extend(['-C', '-']) + else: + curl_cmd.extend(['-z', local_file_path]) curl_cmd.append(full_url) print("Downloading %s..." % full_url) try: