diff --git a/devine/core/downloaders/curl_impersonate.py b/devine/core/downloaders/curl_impersonate.py index 174f09b..2ec879f 100644 --- a/devine/core/downloaders/curl_impersonate.py +++ b/devine/core/downloaders/curl_impersonate.py @@ -96,6 +96,7 @@ def curl_impersonate( download_sizes.clear() break except Exception as e: + out_path.unlink(missing_ok=True) if DOWNLOAD_CANCELLED.is_set() or attempts == MAX_ATTEMPTS: raise e time.sleep(RETRY_WAIT) diff --git a/devine/core/downloaders/requests.py b/devine/core/downloaders/requests.py index 844c1a3..f7c4278 100644 --- a/devine/core/downloaders/requests.py +++ b/devine/core/downloaders/requests.py @@ -98,6 +98,7 @@ def requests( download_sizes.clear() break except Exception as e: + out_path.unlink(missing_ok=True) if DOWNLOAD_CANCELLED.is_set() or attempts == MAX_ATTEMPTS: raise e time.sleep(RETRY_WAIT)