Skip to content

Commit

Permalink
[exhentai] detect CAPTCHAs during login (#5492)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Apr 19, 2024
1 parent 068ccfe commit ddffeea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gallery_dl/extractor/exhentai.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ def _login_impl(self, username, password):
self.cookies.clear()

response = self.request(url, method="POST", headers=headers, data=data)
if b"You are now logged in as:" not in response.content:
content = response.content
if b"You are now logged in as:" not in content:
if b"The captcha was not entered correctly" in content:
raise exception.AuthenticationError(
"CAPTCHA required. Use cookies instead.")
raise exception.AuthenticationError()

# collect more cookies
Expand Down

0 comments on commit ddffeea

Please sign in to comment.