Skip to content

Bulk asynchronous downloader for multiple file hosts

re-arrange so only one login to thotbay instead of multiple....

Jules-WinnfieldX16f2e42354a0
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index 0d4f03098..517f12ed5 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "2.11.5"
+__version__ = "2.11.6"
diff --git a/cyberdrop_dl/utils/scraper.py b/cyberdrop_dl/utils/scraper.py
index b22db8bb5..2ed401843 100644
--- a/cyberdrop_dl/utils/scraper.py
+++ b/cyberdrop_dl/utils/scraper.py
@@ -22,17 +22,14 @@ async def scrape(urls, include_id: bool, thotsbay_username: str, thotsbay_passwo
chibisafe_crawler = ChibisafeCrawler(include_id=include_id)
gofile_crawler = GofileCrawler()
anonfiles_crawler = AnonfilesCrawler(include_id=include_id)
- thotsbay_crawler = ThotsbayCrawler(include_id=include_id, username=thotsbay_username, password=thotsbay_password,
- erome_crawler=erome_crawler, sharex_crawler=sharex_crawler,
- chibisafe_crawler=chibisafe_crawler, gofile_crawler=gofile_crawler,
- anonfiles_crawler=anonfiles_crawler)
+
tasks = []
headers = {"user-agent": user_agent}
jar = aiohttp.CookieJar(quote_cookie=False)
- # Returns Domain items
async with aiohttp.ClientSession(headers=headers, raise_for_status=True, cookie_jar=jar) as session:
+ # Returns Domain items
for url in Erome_urls:
tasks.append(erome_crawler.fetch(session, url))
for url in ShareX_urls:
@@ -45,19 +42,23 @@ async def scrape(urls, include_id: bool, thotsbay_username: str, thotsbay_passwo
tasks.append(anonfiles_crawler.fetch(session, url))
results = await asyncio.gather(*tasks)
- for domain_item in results:
- Cascade.add_albums(domain_item)
+ for domain_item in results:
+ Cascade.add_albums(domain_item)
- # Returns a Cascade item
- tasks2 = []
- async with aiohttp.ClientSession(headers=headers, raise_for_status=True, cookie_jar=jar) as session:
+ thotsbay_crawler = ThotsbayCrawler(include_id=include_id, username=thotsbay_username,
+ password=thotsbay_password,
+ erome_crawler=erome_crawler, sharex_crawler=sharex_crawler,
+ chibisafe_crawler=chibisafe_crawler, gofile_crawler=gofile_crawler,
+ anonfiles_crawler=anonfiles_crawler, session=session)
+
+ # Returns a Cascade item
+ tasks2 = []
for url in Thotsbay_urls:
tasks2.append(thotsbay_crawler.fetch(session, url))
results = await asyncio.gather(*tasks2)
- for result in results:
- Cascade.extend(result)
+ for result in results:
+ Cascade.extend(result)
Cascade.cookies = jar
-
return Cascade