captcha

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidCaptchaType

func IsValidCaptchaType(s string) bool

IsValidCaptchaType reports whether the provided string maps to a known CaptchaType

Types

type CaptchaDetector

type CaptchaDetector struct{}

CaptchaDetector detects CAPTCHA protection in forms using multi-layer detection

func (*CaptchaDetector) DetectInForm

func (cd *CaptchaDetector) DetectInForm(form *goquery.Selection) CaptchaType

DetectInForm detects CAPTCHA in a form element using comprehensive detection methods

type CaptchaType

type CaptchaType string

CaptchaType represents a detected CAPTCHA type

const (
	// Known providers
	CaptchaTypeNone               CaptchaType = "none"
	CaptchaTypeRecaptcha          CaptchaType = "recaptcha"
	CaptchaTypeRecaptchaV2        CaptchaType = "recaptchav2"
	CaptchaTypeRecaptchaInvisible CaptchaType = "recaptcha-invisible"
	CaptchaTypeHCaptcha           CaptchaType = "hcaptcha"
	CaptchaTypeTurnstile          CaptchaType = "turnstile"
	CaptchaTypeGeetest            CaptchaType = "geetest"
	CaptchaTypeFriendlyCaptcha    CaptchaType = "friendlycaptcha"
	CaptchaTypeRotateCaptcha      CaptchaType = "rotatecaptcha"
	CaptchaTypeClickCaptcha       CaptchaType = "clickcaptcha"
	CaptchaTypeImageCaptcha       CaptchaType = "imagecaptcha"
	CaptchaTypePuzzleCaptcha      CaptchaType = "puzzlecaptcha"
	CaptchaTypeSliderCaptcha      CaptchaType = "slidercaptcha"
	CaptchaTypeMCaptcha           CaptchaType = "mcaptcha"
	CaptchaTypeDatadome           CaptchaType = "datadome"
	CaptchaTypePerimeterX         CaptchaType = "perimeterx"
	CaptchaTypeArgon              CaptchaType = "argon"
	CaptchaTypeBehaviotech        CaptchaType = "behaviotech"
	CaptchaTypeSmartCaptcha       CaptchaType = "smartcaptcha"
	CaptchaTypeYandex             CaptchaType = "yandex"
	CaptchaTypeFuncaptcha         CaptchaType = "funcaptcha"
	CaptchaTypeKasada             CaptchaType = "kasada"
	CaptchaTypeImperva            CaptchaType = "imperva"
	CaptchaTypeAwsWaf             CaptchaType = "awswaf"
	CaptchaTypeCoingecko          CaptchaType = "wsiz" // wsiz refers to wsiz.com, Coingecko's bot-protection vendor
	CaptchaTypeNovaScape          CaptchaType = "novascape"
	CaptchaTypeSimple             CaptchaType = "simplecaptcha"
	CaptchaTypeOther              CaptchaType = "other"
)

func DetectCaptchaInHTML

func DetectCaptchaInHTML(html string) CaptchaType

DetectCaptchaInHTML performs a best-effort detection on a full HTML string. It uses precompiled regex patterns (htmlIntegrationPatterns) that require captcha keywords to appear in integration contexts (script src, class/id attributes, data-sitekey, iframes) rather than bare mentions in navigation links or text content.

func (CaptchaType) String

func (ct CaptchaType) String() string

String returns the string representation of CaptchaType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL