Skip to content

Bulk asynchronous downloader for multiple file hosts

Fix endless forum login (#659) (#711)

Johannes Thiemee9c2a77c185
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index d0e4bf8a0..88bee9e54 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "5.0.86"
+__version__ = "5.0.87"
diff --git a/cyberdrop_dl/scraper/crawler.py b/cyberdrop_dl/scraper/crawler.py
index 727aac75e..ee7ff8507 100644
--- a/cyberdrop_dl/scraper/crawler.py
+++ b/cyberdrop_dl/scraper/crawler.py
@@ -110,13 +110,14 @@ class Crawler(ABC):
while True:
try:
+ attempt += 1
if attempt == 5:
raise FailedLoginFailure(status=403, message="Failed to login after 5 attempts")
assert login_url.host is not None
text = await self.client.get_text(self.domain, login_url)
- if "You are already logged in" in text:
+ if '<span class="p-navgroup-user-linkText">' in text:
self.logged_in = True
return
@@ -137,12 +138,11 @@ class Crawler(ABC):
await self.client.post_data(self.domain, login_url / "login", data=data, req_resp=False)
await asyncio.sleep(wait_time)
text = await self.client.get_text(self.domain, login_url)
- if "You are already logged in" not in text:
+ if '<span class="p-navgroup-user-linkText">' not in text:
continue
-
self.logged_in = True
+ break
except asyncio.exceptions.TimeoutError:
- attempt += 1
continue
"""~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"""