Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
also match hash when comparing other files
datawhoresf580bfbd742f
diff --git a/cyberdrop_dl/clients/hash_client.py b/cyberdrop_dl/clients/hash_client.pyindex 0c83f3ff2..2e4ca185e 100644--- a/cyberdrop_dl/clients/hash_client.py+++ b/cyberdrop_dl/clients/hash_client.py@@ -69,8 +69,9 @@ class HashClient:for ele in final_list:hash=ele[0]path=ele[1]+ size=pathlib.Path(path).stat().st_size# get all files with same hash- all_matches=list(map(lambda x:pathlib.Path(x[0],x[1]),await self.manager.db_manager.hash_table.get_files_with_hash_matches(hash)))+ all_matches=list(map(lambda x:pathlib.Path(x[0],x[1]),await self.manager.db_manager.hash_table.get_files_with_hash_matches(hash,size)))# delete files if more then one match existsmatches=list(filter(lambda x:x!=path and x.exists(),all_matches))if len(matches)==0:diff --git a/cyberdrop_dl/utils/database/tables/hash_table.py b/cyberdrop_dl/utils/database/tables/hash_table.pyindex 08ade5356..2a70d65e9 100644--- a/cyberdrop_dl/utils/database/tables/hash_table.py+++ b/cyberdrop_dl/utils/database/tables/hash_table.py@@ -48,7 +48,7 @@ class HashTable:print(f"Error checking file: {e}")return False- async def get_files_with_hash_matches(self,hash_value):+ async def get_files_with_hash_matches(self,hash_value,size):"""Retrieves a list of (folder, filename) tuples based on a given hash.@@ -62,7 +62,7 @@ class HashTable:cursor = await self.db_conn.cursor()try:- await cursor.execute("SELECT folder, filename FROM hash WHERE hash = ?", (hash_value,))+ await cursor.execute("SELECT folder, filename FROM hash WHERE hash = ? and size=?", (hash_value,size))results = await cursor.fetchall()return resultsexcept Exception as e: