Documentation
¶
Index ¶
- type CloudflareOptions
- type CloudflareType
- type FunCaptchaOptions
- type HCaptchaEnterprise
- type HCaptchaOptions
- type KasadaOptions
- type KasadaSolution
- type Proxy
- type ProxyLogon
- type ProxyType
- type RecaptchaV2Options
- type RecaptchaV3Options
- type Solution
- type SolveService
- type Solver
- func (s *Solver) Cloudflare(o CloudflareOptions) (*Solution, error)
- func (s *Solver) FunCaptcha(o FunCaptchaOptions) (*Solution, error)
- func (s *Solver) GetBalance() (float64, error)
- func (s *Solver) GetService() SolveService
- func (s *Solver) HCaptcha(o HCaptchaOptions) (*Solution, error)
- func (s *Solver) IsValidService(service SolveService) bool
- func (s *Solver) Kasada(o KasadaOptions) (*KasadaSolution, error)
- func (s *Solver) RecaptchaV2(o RecaptchaV2Options) (*Solution, error)
- func (s *Solver) RecaptchaV3(o RecaptchaV3Options) (*Solution, error)
- func (s *Solver) SetService(service SolveService) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudflareOptions ¶ added in v1.2.0
type CloudflareOptions struct { PageURL string Proxy *Proxy // SiteKey is only used for CloudflareTypeTurnstile SiteKey string // Type must only be CloudflareTypeTurnstile if the solver is not capsolver.com Type CloudflareType // Metadata will only be used on capsolver.com, for any other solver it will just append the fields Metadata map[string]string // Action and CData are only used for turnstile. CData is only used for 2captcha and capsolver.com Action string CData string // HTML is only needed for cloudflare challenges HTML string }
CloudflareOptions cloudflare challenges only work with capsolver.com, turnstile works with other solvers
type CloudflareType ¶ added in v1.2.0
type CloudflareType int
const ( CloudflareTypeTurnstile CloudflareType = iota CloudflareTypeChallenge )
type FunCaptchaOptions ¶
type FunCaptchaOptions struct { PageURL string PublicKey string // Subdomain also known as surl is optional Subdomain string // Proxy is optional but recommended Proxy *Proxy // UserAgent is required UserAgent string // Data is the extra data. Can look like: {"\blob\":\"HERE_COMES_THE_blob_VALUE\"} Data string }
type HCaptchaEnterprise ¶
type HCaptchaEnterprise struct { RQData string Sentry bool APIEndpoint string Endpoint string ReportAPI string AssetHost string ImgHost string }
HCaptchaEnterprise Not every captcha service supports every field here
type HCaptchaOptions ¶
type KasadaOptions ¶ added in v1.1.0
type KasadaOptions struct { PageURL string // Proxy is required Proxy *Proxy // DetailedCD Enable if you need more detailed x-kpsdk-cd, including params such as duration, st and rst DetailedCD bool // OnlyCD Enable if the solution contains only x-kpsdk-cd OnlyCD bool // Version Currently supports 2.0 and 3.0, default is 3.0 Version string // UserAgent Browser's User-Agent which is used in emulation. Default is random UserAgent string }
KasadaOptions Make sure to set the proxy as its required
type KasadaSolution ¶ added in v1.1.0
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
func ParseProxy ¶
func (*Proxy) FullString ¶ added in v1.1.2
FullString returns the proxy address, port and type
type ProxyLogon ¶
func (*ProxyLogon) String ¶
func (pl *ProxyLogon) String() string
type RecaptchaV2Options ¶
type RecaptchaV2Options struct { // SiteKey is the site key of the recaptcha SiteKey string // PageURL is the URL of the page where the reCAPTCHA is located PageURL string // DataS is the data-s attribute of the reCAPTCHA element (optional) DataS string // Proxy is the proxy to use for the captcha (optional) Proxy *Proxy // UserAgent is the user agent to use for the captcha (optional) UserAgent string // Cookies is the cookies to use for the captcha (optional) Cookies map[string]string // Invisible is whether the captcha is invisible or not (optional) Invisible bool // Enterprise only works on some captcha services (optional) Enterprise map[string]interface{} // APIDomain is the domain of the recaptcha (optional) APIDomain string }
type RecaptchaV3Options ¶
type RecaptchaV3Options struct { PageURL string SiteKey string Enterprise bool // MinScore should only be 0.3, 0.7, or 0.9 MinScore float64 // Action is the page_action in the requests Action string }
RecaptchaV3Options All fields are required
type Solution ¶
type Solution struct { Text string // TaskId is normally a int, but can be a string depending on the service TaskId any // RawSolution not supported on 2captcha methods RawSolution map[string]interface{} // Speed the time in milliseconds that the captcha took to solve Speed int64 // Cookies can be nil or empty if the service does not return cookies Cookies map[string]string // Cost can be "" if the service does not return cost Cost string // IP can be "" if the service does not return IP IP string }
type SolveService ¶
type SolveService = string
const ( AntiCaptcha SolveService = "anticaptcha" AnyCaptcha SolveService = "anycaptcha" CapSolver SolveService = "capsolver" TwoCaptcha SolveService = "2captcha" CapMonster SolveService = "capmonster" )
type Solver ¶
type Solver struct { // UpdateDelay is the delay between each update getTaskResult request UpdateDelay time.Duration // Disabling Verbose will disable all logging Verbose bool // ApiKey is the key used to authenticate with the service ApiKey string // ForcedDomain don't edit unless you know what you're doing. // This is used to allow the user to change their captcha service to whatever // they want as long as they share the same api methods. ForcedDomain string // contains filtered or unexported fields }
func (*Solver) Cloudflare ¶ added in v1.2.0
func (s *Solver) Cloudflare(o CloudflareOptions) (*Solution, error)
func (*Solver) FunCaptcha ¶
func (s *Solver) FunCaptcha(o FunCaptchaOptions) (*Solution, error)
func (*Solver) GetBalance ¶
GetBalance returns the balance of the account
func (*Solver) GetService ¶
func (s *Solver) GetService() SolveService
func (*Solver) IsValidService ¶ added in v1.0.0
func (s *Solver) IsValidService(service SolveService) bool
func (*Solver) Kasada ¶ added in v1.1.0
func (s *Solver) Kasada(o KasadaOptions) (*KasadaSolution, error)
Kasada is only supported with capsolver.com
func (*Solver) RecaptchaV2 ¶
func (s *Solver) RecaptchaV2(o RecaptchaV2Options) (*Solution, error)
RecaptchaV2 solves a recaptcha v2
func (*Solver) RecaptchaV3 ¶
func (s *Solver) RecaptchaV3(o RecaptchaV3Options) (*Solution, error)
func (*Solver) SetService ¶
func (s *Solver) SetService(service SolveService) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.