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 @@ async def forum_login(self, login_url: URL, session_cookie: str, username: str, 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 '' in text: self.logged_in = True return @@ -137,12 +138,11 @@ async def forum_login(self, login_url: URL, session_cookie: str, username: str, 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 '' not in text: continue - self.logged_in = True + break except asyncio.exceptions.TimeoutError: - attempt += 1 continue """~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"""