Add Peak API solver for Cloudflare Turnstile - #16
Open
CircuitSavage wants to merge 2 commits into
Open
Conversation
Adds Peak (peak.fo) as an API solver option, following the same pattern as the existing TwoCaptcha and TenCaptcha solvers: - AsyncPeakClient: minimal httpx client for the Peak /solve and /balance endpoints - PeakSolver(ApiSolverBase): detect -> solve -> apply flow, mirrors TwoCaptchaSolver - SolverType.peak enum member and registration for Cloudflare Turnstile - Example at examples/cloudflare/peak_turnstile.py - README entry under the API Solver section Peak returns the token in a single request (no submit-then-poll) and charges only for successful solves.
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.
What this adds
A new API solver, Peak (peak.fo), for Cloudflare Turnstile. It slots in next to the existing
TwoCaptchaSolverandTenCaptchaSolverand uses the sameApiSolverBaseflow, so usage looks identical to the current API solvers.Why it might be useful here
Peak returns the token in a single request instead of the submit-then-poll loop, and it charges only for solves that succeed. For people already using this library's API-solver path, it's one more provider to choose from.
Changes
solvers/api/peak/peak_client.py— smallhttpxclient for the/solveand/balanceendpointssolvers/api/peak/peak_solver.py—PeakSolver(ApiSolverBase), mirrorsTwoCaptchaSolver(detect → solve → apply)types/solvers.py— addsSolverType.peakcaptchas/cloudflare_turnstile/__init__.py— registers the solver for Turnstileplaywright_captcha/__init__.py— exportsPeakSolverexamples/cloudflare/peak_turnstile.py— runnable exampleREADME.md— entry under the API Solver sectionNotes
httpxis already used across the project).