From 9e1608372b7059f01c36df8f7f419fec52093a3d Mon Sep 17 00:00:00 2001 From: Nikhil Badyal Date: Sun, 2 Jul 2023 13:02:32 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Don't=20download=20if=20file=20alre?= =?UTF-8?q?ady=20exist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/downloader.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/downloader.py b/src/downloader.py index 84b6e30..e211955 100644 --- a/src/downloader.py +++ b/src/downloader.py @@ -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()