Skip to content

Commit

Permalink
Merge pull request #208 from BelKed/captcha-problems
Browse files Browse the repository at this point in the history
Add an error case for CAPTCHA problems
  • Loading branch information
FriedrichFroebel authored Mar 27, 2023
2 parents 89feb55 + e812239 commit ca5fb04
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pycaching/geocaching.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def login(self, username=None, password=None):
return
else:
self.logout()

if after_login_page.find("div", class_="g-recaptcha"):
raise LoginFailedException("CAPTCHA is required to login to the site.")

raise LoginFailedException("Cannot login to the site (probably wrong username or password).")

def _load_credentials(self, username=None):
Expand Down

0 comments on commit ca5fb04

Please sign in to comment.