-
Notifications
You must be signed in to change notification settings - Fork 72
Add captchasolver plugin #77
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
Open
kent13n
wants to merge
16
commits into
Overmiind:master
Choose a base branch
from
kent13n:add-captchasolver-plugin
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
- Introduced `CaptchaSolverPlugin` to handle various CAPTCHA solving scenarios. - Implemented `CapSolver` as a provider for solving reCAPTCHAs, with support for V2 and V3. - Added models, enums, and helper methods for better CAPTCHA management. - Included support for configurable options like timeouts and polling attempts. - Provided initial integration scripts for Google reCAPTCHA handling.
- Moved Google CAPTCHA task creation logic to a dedicated method. - Added support check and exception handling for unsupported CAPTCHA vendors.
- Introduced `GoogleOptions` class with customizable properties for solving Google reCAPTCHAs (e.g., `MinV3RecaptchaScore`, `CaptchaWaitTimeout`). - Updated default vendor configuration to use `GoogleOptions` for Google reCAPTCHAs. - Enhanced Google handler to include vendor-specific options in task creation.
- Introduced `HCaptchaHandler` to detect hCaptcha challenges and handle related operations. - Added initial hCaptcha integration in CapSolver API with dedicated task creation. - Updated scripts for hCaptcha detection and visual feedback. - Disabled hCaptcha solving support temporarily due to compliance and reliability issues. - Included unit tests for validating hCaptcha detection functionality.
- Introduced `CloudflareHandler` to detect and solve Cloudflare Turnstile challenges. - Added Cloudflare Turnstile task creation in CapSolver API. - Developed content scripts for widget detection, visual feedback, and solution handling. - Included unit tests for Cloudflare Turnstile CAPTCHA solving verification. - Updated related scripts and APIs to integrate with the new vendor.
- Updated method names in `CloudflareHandler` and `CloudflareScript` to replace "Turnstile" with "Captcha". - Ensured uniform terminology across detection and solution handling functions.
- Added support for Cloudflare Turnstile and GeeTest in the README. - Updated provider examples to include CapSolver. - Replaced `RecaptchaPlugin` references with `CaptchaSolverPlugin`. - Revised code samples to reflect changes in option naming and initialization.
…d add response processing hooks - Updated handlers (`CloudflareHandler`, `GoogleHandler`, `HCaptchaHandler`) to simplify method signatures by removing redundant `IPage` arguments. - Added `ProcessResponseAsync` hooks to enable response-based CAPTCHA management. - Modified `CreateHandler` helper to include `IPage` in handler initialization. - Updated `CaptchaSolverPlugin` to connect response hooks for supported vendors.
…d signatures, and enhance error handling across handlers and scripts
- Introduced `GeeTestHandler` for detecting and solving GeeTest CAPTCHAs. - Added GeeTest task creation logic in CapSolver API with required fields (`gt`, `challenge`, `captchaId`). - Developed GeeTest content scripts for widget detection, visual feedback, and solution handling. - Extended CAPTCHA models to include GeeTest-specific properties (`Gt`, `Challenge`, `CaptchaId`). - Added unit tests to validate GeeTest CAPTCHA solving functionality.
- Implemented `TwoCaptcha` provider with task creation and solution retrieval logic. - Developed helper methods for handling Google, hCaptcha, GeeTest, and Cloudflare Turnstile task structures. - Added error handling and response validation for API interactions. - Introduced models for TwoCaptcha responses (`TwoCaptchaCreateTaskResponse`, `TwoCaptchaGetTaskResult`).
- Introduced `GeeTestV4` support with updated logic in `GeeTestHandler` and CapSolver API. - Added `Version` property to the `Captcha` model for version-specific handling. - Refactored handlers (`CloudflareHandler`, `GoogleHandler`, `HCaptchaHandler`) with `HandleOnPageCreatedAsync` implementation. - Improved GeeTest content script for better challenge tracking and efficiency. - Enhanced unit tests to validate `GeeTestV4` solving functionality.
- Renamed `RecaptchaTests` class to `GoogleTests` for consistency with naming conventions. - Added new unit tests to validate solving for various Google CAPTCHA scenarios, including invisible and v3 challenges. - Updated test logic to include additional assertions and reduced delays for improved efficiency. - Improved `GeeTestHandler` to handle cases where CAPTCHA selectors are not found, adding fallback return logic for better reliability.
- Added unit tests for solving CAPTCHAs with TwoCaptcha, covering scenarios for Google, Cloudflare, hCaptcha, and GeeTest. - Improved task creation and request handling in `TwoCaptchaApi`, including support for GeeTest v4 and Turnstile challenges. - Refined error handling, renamed task types for consistency, and enhanced API parameter validation.
… handling, and enhance hCaptcha unit tests - Introduced `FindCaptchaAsync` method, separating CAPTCHA discovery from solving for improved modularity. - Enhanced error handling in `SolveCaptchaAsync` and `FindCaptchaAsync` to validate response integrity and streamline fallback behavior. - Updated hCaptcha tests to include assertions for detected CAPTCHAs and error handling scenarios. - Revised `readme.md` to reflect updates in plugin architecture, vendor support, and usage examples. - Optimized vendor handlers and method signatures for consistency across CAPTCHA types.
…tchaAsync` with `FindCaptchaAsync`, add assertions, and cleanup comments
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.
Add CaptchaSolver Plugin - Multi-Vendor CAPTCHA Solving
Overview
This PR introduces a new CaptchaSolver plugin providing a unified interface for detecting and solving CAPTCHAs across multiple vendors. It consolidates and extends the previous RecaptchaPlugin while maintaining full backward compatibility.
Supported Vendors
Supported Providers
The plugin is designed with an extensible provider interface, making it straightforward to integrate additional solvers in the future.
Key Features
Usage
Notes
Credits
Inspired by https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-recaptcha.