fix: improve CAPTCHA auto-solver reliability - #65
Open
amorr42 wants to merge 1 commit into
Open
Conversation
- Use dedicated Session with proper headers (user-agent, accept, content-type) instead of internal _get() for captcha API calls - Read nLeadingZerosRequired dynamically from API response instead of hardcoded default of 13 - Add finalize step after CAPTCHA validation - Add error handling for failed auth responses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The existing
_auto_solve_captchaimplementation had several issues causing login failures:_get()for captcha API calls — this routed requests through the main session without the required captcha-specific headers, causing request rejections.nLeadingZerosRequiredwas hardcoded to13instead of being read from the API response, breaking challenge solving when the server changes this value./finalizestep after validation — the captcha flow was incomplete.Fix
Sessionwith explicit headers (accept,content-type,user-agent) for all captcha API callsnLeadingZerosRequirednow read dynamically frominit_dataresponse/finalizeAPI call to properly complete the captcha flowCodefieldTesting
Tested against a live ProtonMail account where login was previously failing due to CAPTCHA. Login succeeds consistently after this fix.