Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
Remove intermediate downloaders list
Arkadiy Illarionov23a663fc9c7a
diff --git a/cyberdrop_dl/downloader/downloaders.py b/cyberdrop_dl/downloader/downloaders.pyindex 3fad2b3cb..7138b3957 100644--- a/cyberdrop_dl/downloader/downloaders.py+++ b/cyberdrop_dl/downloader/downloaders.py@@ -348,16 +348,13 @@ async def download_cascade(args: dict, Cascade: CascadeItem, SQL_Helper: SQLHelpcascade_task = cascade_progress.add_task("[light_salmon3]Domains", progress_type="cascade",total=len(Cascade.domains))- downloaders = []tasks = []for domain, domain_obj in Cascade.domains.items():threads = user_threads if user_threads != 0 else multiprocessing.cpu_count()if 'bunkr' in domain or 'pixeldrain' in domain or 'anonfiles' in domain:threads = 2 if (threads > 2) else threads- downloaders.append(Downloader(args, client, SQL_Helper, scraper, threads, domain, domain_obj,- files))- for downloader in downloaders:+ downloader = Downloader(args, client, SQL_Helper, scraper, threads, domain, domain_obj, files)tasks.append(downloader.start_domain(cascade_task))await asyncio.gather(*tasks)@@ -385,16 +382,13 @@ async def download_forums(args: dict, Forums: ForumItem, SQL_Helper: SQLHelper,for title, Cascade in Forums.threads.items():cascade_task = cascade_progress.add_task("[light_salmon3]" + title.upper(), total=len(Cascade.domains))- downloaders = []tasks = []for domain, domain_obj in Cascade.domains.items():threads = user_threads if user_threads != 0 else multiprocessing.cpu_count()if 'bunkr' in domain or 'pixeldrain' in domain or 'anonfiles' in domain:threads = 2 if (threads > 2) else threads- downloaders.append(Downloader(args, client, SQL_Helper, scraper, threads, domain, domain_obj,- files))- for downloader in downloaders:+ downloader = Downloader(args, client, SQL_Helper, scraper, threads, domain, domain_obj, files)tasks.append(downloader.start_domain(cascade_task))await asyncio.gather(*tasks)cascade_progress.update(cascade_task, visible=False)diff --git a/cyberdrop_dl/downloader/old_downloaders.py b/cyberdrop_dl/downloader/old_downloaders.pyindex 549cb5890..11ff37d7d 100644--- a/cyberdrop_dl/downloader/old_downloaders.py+++ b/cyberdrop_dl/downloader/old_downloaders.py@@ -288,7 +288,6 @@ async def old_download_cascade(args: dict, Cascade: CascadeItem, SQL_Helper: SQLfiles = Files()- downloaders = []tasks = []total_files = await Cascade.get_total()with tqdm(total=total_files, unit_scale=True, unit='Files', leave=True, initial=0,@@ -297,9 +296,8 @@ async def old_download_cascade(args: dict, Cascade: CascadeItem, SQL_Helper: SQLthreads = user_threads if user_threads != 0 else multiprocessing.cpu_count()if 'bunkr' in domain or 'pixeldrain' in domain or 'anonfiles' in domain:threads = 2 if (threads > 2) else threads- downloaders.append(Old_Downloader(args, client, SQL_Helper, scraper, threads, domain, domain_obj,- files, progress))- for downloader in downloaders:+ downloader = Old_Downloader(args, client, SQL_Helper, scraper, threads, domain, domain_obj,+ files, progress)tasks.append(downloader.start_domain())await asyncio.gather(*tasks)@@ -318,16 +316,14 @@ async def old_download_forums(args: dict, Forums: ForumItem, SQL_Helper: SQLHelpwith tqdm(total=total_files, unit_scale=True, unit='Files', leave=True, initial=0,desc="Files Downloaded") as progress:for title, Cascade in Forums.threads.items():- downloaders = []tasks = []for domain, domain_obj in Cascade.domains.items():threads = user_threads if user_threads != 0 else multiprocessing.cpu_count()if 'bunkr' in domain or 'pixeldrain' in domain or 'anonfiles' in domain:threads = 2 if (threads > 2) else threads- downloaders.append(Old_Downloader(args, client, SQL_Helper, scraper, threads, domain, domain_obj,- files, progress))- for downloader in downloaders:+ downloader = Old_Downloader(args, client, SQL_Helper, scraper, threads, domain, domain_obj,+ files, progress)tasks.append(downloader.start_domain())await asyncio.gather(*tasks)