From eb9db2dabc277972812cfc46ae19a55c7b59e1ef Mon Sep 17 00:00:00 2001 From: Jules-WinnfieldX Date: Wed, 6 Dec 2023 14:53:46 -0700 Subject: [PATCH] Fix downloader naming collisions --- cyberdrop_dl/__init__.py | 2 +- cyberdrop_dl/downloader/downloader.py | 12 ++++++++++-- pyproject.toml | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py index 59e9770d9..b8ace7e66 100644 --- a/cyberdrop_dl/__init__.py +++ b/cyberdrop_dl/__init__.py @@ -1 +1 @@ -__version__ = "5.0.62" +__version__ = "5.0.63" diff --git a/cyberdrop_dl/downloader/downloader.py b/cyberdrop_dl/downloader/downloader.py index 9cc5cbea5..300a854e2 100644 --- a/cyberdrop_dl/downloader/downloader.py +++ b/cyberdrop_dl/downloader/downloader.py @@ -270,8 +270,16 @@ async def get_final_file_info(self, complete_file: Path, partial_file: Path, if media_item.filename == downloaded_filename: if partial_file.exists(): if partial_file.stat().st_size == media_item.filesize: - proceed = False - partial_file.rename(complete_file) + if complete_file.exists(): + new_complete_filename, new_partial_file = await self.iterate_filename(complete_file, media_item) + partial_file.rename(new_complete_filename) + proceed = False + + complete_file = new_complete_filename + partial_file = new_partial_file + else: + proceed = False + partial_file.rename(complete_file) elif complete_file.exists(): if complete_file.stat().st_size == media_item.filesize: proceed = False diff --git a/pyproject.toml b/pyproject.toml index 5e550a38e..c1167b4b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cyberdrop-dl" -version = "5.0.62" +version = "5.0.63" description = "Bulk downloader for multiple file hosts" authors = ["Jules Winnfield "] readme = "README.md"