Skip to content

Bulk asynchronous downloader for multiple file hosts

Set no warnings

Jules-WinnfieldXbf09fd5129b6
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index b0667157a..3f2a230f6 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "5.1.41"
+__version__ = "5.1.42"
diff --git a/cyberdrop_dl/scraper/crawlers/ehentai_crawler.py b/cyberdrop_dl/scraper/crawlers/ehentai_crawler.py
index 8ec78a23a..3de30af7d 100644
--- a/cyberdrop_dl/scraper/crawlers/ehentai_crawler.py
+++ b/cyberdrop_dl/scraper/crawlers/ehentai_crawler.py
@@ -19,6 +19,7 @@ class EHentaiCrawler(Crawler):
def __init__(self, manager: Manager):
super().__init__(manager, "e-hentai", "E-Hentai")
self.request_limiter = AsyncLimiter(10, 1)
+ self.warnings_set = False
"""~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"""
@@ -26,8 +27,10 @@ class EHentaiCrawler(Crawler):
"""Determines where to send the scrape item based on the url"""
task_id = await self.scraping_progress.add_task(scrape_item.url)
+ if not self.warnings_set:
+ await self.set_no_warnings(scrape_item)
+
if "g" in scrape_item.url.parts:
- scrape_item.url = URL(str(scrape_item.url) + "/").with_query("nw=session")
await self.album(scrape_item)
elif "s" in scrape_item.url.parts:
await self.image(scrape_item)
@@ -85,3 +88,11 @@ class EHentaiCrawler(Crawler):
date = date + ":00"
date = datetime.datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
return calendar.timegm(date.timetuple())
+
+ @error_handling_wrapper
+ async def set_no_warnings(self, scrape_item) -> None:
+ """Sets the no warnings cookie"""
+ self.warnings_set = True
+ async with self.request_limiter:
+ scrape_item.url = URL(str(scrape_item.url) + "/").update_query("nw=session")
+ soup = await self.client.get_BS4(self.domain, scrape_item.url)
diff --git a/pyproject.toml b/pyproject.toml
index 9640b9d46..8e5f8e1e3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
-version = "5.1.41"
+version = "5.1.42"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"