projectdiscovery/katana · error

unsupported captcha provider for capsolver: %s

Error message

unsupported captcha provider for capsolver: %s

What it means

capsolver.Solver.Solve returns this when info.Provider is not a key in the taskTypes map, i.e. the captcha provider is one the capsolver integration does not support (it supports reCAPTCHA v2/v3 (+Enterprise), Turnstile, and hCaptcha). The solver cannot map the provider to a capsolver task type and fails before making any API call.

Source

Thrown at pkg/engine/headless/captcha/capsolver/capsolver.go:56

}

func init() {
	captcha.RegisterSolver("capsolver", func(apiKey string) (captcha.Solver, error) {
		return New(apiKey), nil
	})
}

func New(apiKey string) *Solver {
	return &Solver{
		apiKey: apiKey,
		client: &http.Client{Timeout: 30 * time.Second},
	}
}

func (s *Solver) Solve(ctx context.Context, info *captcha.Info) (*captcha.Solution, error) {
	taskType, ok := taskTypes[info.Provider]
	if !ok {
		return nil, fmt.Errorf("unsupported captcha provider for capsolver: %s", info.Provider)
	}

	task := map[string]any{
		"type":       taskType,
		"websiteURL": info.PageURL,
		"websiteKey": info.SiteKey,
	}
	if (info.Provider == captcha.ProviderRecaptchaV3 || info.Provider == captcha.ProviderRecaptchaV3Enterprise) && info.Action != "" {
		task["pageAction"] = info.Action
	}

	taskID, err := s.createTask(ctx, task)
	if err != nil {
		return nil, fmt.Errorf("create task: %w", err)
	}

	return s.pollResult(ctx, taskID, info.Provider)
}

View on GitHub (pinned to e3e742739c)

Solutions

  1. Check the provider in captcha.Info against the taskTypes map in capsolver.go and use a supported one (RecaptchaV2/V3, Enterprise variants, Turnstile, HCaptcha).
  2. Switch the solver backend (e.g. 2captcha) for providers capsolver does not support.
  3. Update the library or add an entry to taskTypes if the provider has a capsolver equivalent.
  4. Log the detected provider before solving to catch misdetection early.

Example fix

// before
solver := capsolver.New(apiKey)
sol, err := solver.Solve(ctx, &captcha.Info{Provider: captcha.ProviderFuncaptcha, ...}) // unsupported
// after
if info.Provider == captcha.ProviderFuncaptcha {
    solver, _ = twocaptcha.New(apiKey) // backend that supports it
}
sol, err := solver.Solve(ctx, info)
Defensive patterns

Strategy: validation

Validate before calling

var supportedByCapsolver = map[captcha.Provider]bool{
    captcha.ProviderRecaptchaV2: true, captcha.ProviderRecaptchaV3: true,
    captcha.ProviderRecaptchaV2Enterprise: true, captcha.ProviderRecaptchaV3Enterprise: true,
    captcha.ProviderTurnstile: true, captcha.ProviderHCaptcha: true,
}
if !supportedByCapsolver[info.Provider] {
    return nil, fmt.Errorf("provider %s not supported by capsolver", info.Provider)
}

Try / catch

sol, err := solver.Solve(ctx, info)
if err != nil {
    if strings.HasPrefix(err.Error(), "unsupported captcha provider for capsolver") {
        return nil, fallbackSolver.Solve(ctx, info) // route to a backend that supports it
    }
    return nil, err
}

Prevention

When it happens

Trigger: Calling Solve(ctx, info) (directly or via solveCaptcha) with info.Provider set to a provider outside taskTypes — e.g. image captcha, FunCaptcha, or a provider only supported by another solver backend.

Common situations: Configuring capsolver as the captcha solver while the target site presents a captcha type capsolver integration doesn't map; provider auto-detection returning a provider name not in the map; mixing solver backends where a provider is supported by 2captcha but not capsolver.

Related errors


AI-assisted analysis of projectdiscovery/katana@e3e742739c (2026-09-03). Data as JSON: /api/errors/801a743d2e6391af. Report an issue: GitHub.