Skip to content

Bulk asynchronous downloader for multiple file hosts

handle some edge cases (#334)

datawhores957d38502064
diff --git a/cyberdrop_dl/clients/hash_client.py b/cyberdrop_dl/clients/hash_client.py
index 92bec6a0f..fdf7d53ff 100644
--- a/cyberdrop_dl/clients/hash_client.py
+++ b/cyberdrop_dl/clients/hash_client.py
@@ -79,7 +79,11 @@ class HashClient:
key = self._get_key_from_file(file)
file = Path(file)
if not file.is_file():
- return None
+ return
+ elif file.stat().st_size == 0:
+ return
+ elif file.suffix == ".part":
+ return
if self.hashes[(key, hash_type)]:
return self.hashes[(key, hash_type)]
self.manager.progress_manager.hash_progress.update_currently_hashing(file)
@@ -160,7 +164,7 @@ class HashClient:
item = media_item.complete_file.absolute()
try:
size = item.stat().st_size
- if hash:
+ if hash and Path(item).exists():
hashes_dict[hash][size].append(item)
except Exception as e:
log(f"After hash processing failed: {item} with error {e}", 40, exc_info=True)