Skip to content

Bulk asynchronous downloader for multiple file hosts

refactor: filter files to dedupe

NTFSvolumeb85b18b65a29
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1685d698b..a282be49a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Remove hardcoded limit of 1 concurrent download per server (Bunkr)
+- Do not dedupe files that were not downloaded in the current session
## [10.0.2] - 2026-07-05
diff --git a/cyberdrop_dl/dedupe.py b/cyberdrop_dl/dedupe.py
index 84b2ca41f..868d89cd6 100644
--- a/cyberdrop_dl/dedupe.py
+++ b/cyberdrop_dl/dedupe.py
@@ -53,15 +53,17 @@ class Czkawka:
async def _dedupe(self, file_hashes: FileHashes) -> None:
async with asyncio.TaskGroup() as tg:
- async def delete_dupes(hash_value: str, size: int) -> None:
+ async def delete_dupes(hash_value: str, size: int, paths: set[Path]) -> None:
db_matches = await self.database.hash.get_files_with_hash_matches(hash_value, size, "xxh128")
for file in _filter_db_matches(db_matches, self.base_dir):
+ if file not in paths:
+ continue
await self._sem.acquire()
tg.create_task(self._delete_and_log(file, hash_value))
for hash_value, sizes in file_hashes.items():
- for size in sizes:
- tg.create_task(delete_dupes(hash_value, size))
+ for size, paths in sizes.items():
+ tg.create_task(delete_dupes(hash_value, size, paths))
async def _delete_and_log(self, file: Path, xxh128_value: str) -> None:
hash_string = f"xxh128:{xxh128_value}"