Skip to content

fix(google): submit captcha form instead of calling removed submitCallback()#34

Open
versaflow wants to merge 1 commit into
karust:mainfrom
versaflow:fix/google-captcha-token-injection
Open

fix(google): submit captcha form instead of calling removed submitCallback()#34
versaflow wants to merge 1 commit into
karust:mainfrom
versaflow:fix/google-captcha-token-injection

Conversation

@versaflow

Copy link
Copy Markdown

When the 2captcha solver is enabled, solveCaptcha() in google/search.go set #g-recaptcha-response then called submitCallback(). Google’s current /sorry/ interstitial no longer defines submitCallback(), so the eval throws:

Failed to set captcha response: eval js error:
TypeError: Cannot read properties of undefined (reading "apply")

The 2captcha solve succeeds (token returned and billed) but is never applied, so every Google search still fails with captcha detected / 429.

Fix: set the token on #g-recaptcha-response (value + innerHTML), call submitCallback() only when it still exists, otherwise submit the captcha form directly (form#captcha-form / form[action*="sorry"] / first form), then WaitLoad for the redirect back to the SERP. No behaviour change when submitCallback is present; this only adds a fallback for the current page structure.

🤖 Generated with Claude Code

…lback()

After 2captcha returns a token, solveCaptcha() set
#g-recaptcha-response and called submitCallback(). Google's current
/sorry/ page no longer defines submitCallback(), so the page.Eval threw
"TypeError: Cannot read properties of undefined (reading 'apply')" and
the solved (paid-for) token was discarded — every Google solve failed
with "captcha detected" despite a successful 2captcha solve.

Set the token on #g-recaptcha-response (value + innerHTML), call
submitCallback() only when it still exists, otherwise submit the captcha
form directly, then WaitLoad for Google's redirect back to the SERP.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant