Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more words to make sure that it can detect it in English #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/hcaptcha_solver/hcaptcha_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ def solve_challenge(self, wd, debug=False):
def normalize_captcha_string(captcha_str):
"""normalizes the captcha string"""

if "Please click" not in captcha_str:
words = ["click", "press", "select", "tap", "choose", "verify", "solve", "complete", "pick", "identify", "confirm", "match", "find", "check", "validate", "indicate", "point", "pinpoint", "locate", "spot"]
if not any(word in captcha_str.lower() for word in words):
print("""[WARNING] The captcha string does not appear to be english. \
This version of hcaptcha-solver only supports english captchas, \
consider changing the language of the webhandler""")
Expand Down Expand Up @@ -143,4 +144,4 @@ def normalize_captcha_string(captcha_str):
captcha_str = captcha_str.replace("Please click each image containing ","")
captcha_str = captcha_str.replace("Please click on all images containing a ","")
captcha_str = captcha_str.replace("Please click on all images containing ","")
return captcha_str
return captcha_str