Skip to content

Bulk asynchronous downloader for multiple file hosts

Revert "check files with hash"

datawhoresf98172cb52a9
diff --git a/cyberdrop_dl/clients/download_client.py b/cyberdrop_dl/clients/download_client.py
index 1e312f423..19356d9bd 100644
--- a/cyberdrop_dl/clients/download_client.py
+++ b/cyberdrop_dl/clients/download_client.py
@@ -161,10 +161,10 @@ class DownloadClient:
async def save_content(content: aiohttp.StreamReader) -> None:
await self._append_content(media_item, content, partial(manager.progress_manager.file_progress.advance_file, media_item.task_id))
+
downloaded = await self._download(domain, manager, media_item, save_content)
if downloaded:
media_item.partial_file.rename(media_item.complete_file)
- hash=self.hasher.getfilehash(media_item.complete_file)
await self.mark_completed(media_item, domain)
return downloaded
diff --git a/cyberdrop_dl/managers/hash_manager.py b/cyberdrop_dl/managers/hash_manager.py
deleted file mode 100644
index 6cfea36b2..000000000
--- a/cyberdrop_dl/managers/hash_manager.py
+++ /dev/null
@@ -1,23 +0,0 @@
-
-class Hasher:
- def __init__(self):
- pass
-
- def hash_file(filename):
- file_hash = self.hasher()
- with self.path.open("rb") as fp:
- CHUNK_SIZE = 1024 * 1024 # 1 mb
- filedata = fp.read(CHUNK_SIZE)
- while filedata:
- file_hash.update(filedata)
- filedata = fp.read(CHUNK_SIZE)
- return file_hash.digest()
- @property
- def hasher():
- hasher: Callable
- try:
- import xxhash
- return xxhash.xxh128
- except ImportError:
- import hashlib
- return hashlib.md5