Use CaptchaSolverOptions to control how the plugin detects, filters, and solves CAPTCHAs. You can set these globally when creating the plugin or override them for a specific request.
Key Options:
CaptchaWaitTimeout: Max time to wait for CAPTCHA to appear (default: 5s).ThrowOnError: If true, throws exceptions instead of returning error messages.MinScore: Minimum acceptable score for score-based CAPTCHAs (0.0 - 1.0, default: 0.5).SolveInViewportOnly: If true, only solves CAPTCHAs visible in the viewport.SolveScoreBased: Whether to solve score-based CAPTCHAs like reCAPTCHA v3.SolveInvisibleChallenges: Whether to solve invisible CAPTCHA challenges.EnabledVendors: A dictionary to enable/disable specific vendors and provide vendor-specific options (e.g., GoogleOptions).
var options = new CaptchaSolverOptions
{
CaptchaWaitTimeout = TimeSpan.FromSeconds(10),
ThrowOnError = false,
MinScore = 0.7,
SolveInViewportOnly = false,
SolveScoreBased = true,
SolveInvisibleChallenges = true,
Debug = false,
EnabledVendors = new Dictionary<CaptchaVendor, ICaptchaSolveOptions?>
{
{ CaptchaVendor.Google, new GoogleOptions() },
{ CaptchaVendor.GeeTest, null },
{ CaptchaVendor.Cloudflare, null },
{ CaptchaVendor.HCaptcha, null },
{ CaptchaVendor.DataDome, null }
}
};
var captchaSolver = new CaptchaSolverPlugin(
new CapSolver("YOUR_API_KEY"),
options
);