Don't download if file already exist

This commit is contained in:
Nikhil Badyal
2023-07-02 13:02:32 +05:30
parent 22d9d53e17
commit 9e1608372b
+3
View File
@@ -30,6 +30,9 @@ class Downloader(object):
self.patcher = patcher
def _download(self, url: str, file_name: str) -> None:
if os.path.exists(self.config.temp_folder.joinpath(file_name)):
logger.debug(f"Skipping download of {file_name}. File already exists.")
return
logger.debug(f"Trying to download {file_name} from {url}")
self._QUEUE_LENGTH += 1
start = perf_counter()