anticaptcha

package module
v0.0.0-...-9d1accd Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: Unlicense Imports: 11 Imported by: 1

README

anticaptcha PkgGoDev Go Report Card

This package is an anti-captcha.net client library. See official documentation here

Installation

go get -u github.com/aidenesco/anticaptcha

Usage

import "github.com/aidenesco/anticaptcha"

func main() {
    client := anticaptcha.NewClient("your-key-here")
    
    balance, _ := client.GetBalance(context.Background())
    
    fmt.Println(balance) // 4.77
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client allows programmatic access to the anti-captcha api

func NewClient

func NewClient(key string, opts ...ClientOption) (client *Client)

NewClient returns a new Client with the applied options

func (*Client) Funcaptcha

func (c *Client) Funcaptcha(ctx context.Context, siteURL, siteKey, userAgent string, proxy *url.URL, opts ...OptionalValue) (result FuncaptchaResult, err error)

Funcaptcha submits and retrieves a funcaptcha task

func (*Client) FuncaptchaProxyless

func (c *Client) FuncaptchaProxyless(ctx context.Context, siteURL, siteKey string, opts ...OptionalValue) (result FuncaptchaResult, err error)

FuncaptchaProxyless submits and retrieves a funcaptcha task

func (*Client) GeeTest

func (c *Client) GeeTest(ctx context.Context, siteURL, siteKey, challenge, userAgent string, proxy *url.URL, opts ...OptionalValue) (result GeeTestResult, err error)

GeeTest submits and retrieves a geetest task

func (*Client) GeeTestProxyless

func (c *Client) GeeTestProxyless(ctx context.Context, siteURL, siteKey, challenge string, opts ...OptionalValue) (result GeeTestResult, err error)

GeeTestProxyless submits and retrieves a geetest task

func (*Client) GetBalance

func (c *Client) GetBalance(ctx context.Context) (balance float64, err error)

GetBalance retrieves the current account balance

func (*Client) HCaptcha

func (c *Client) HCaptcha(ctx context.Context, siteURL, siteKey, userAgent string, proxy *url.URL, opts ...OptionalValue) (result HCaptchaResult, err error)

HCaptcha submits and retrieves a hcaptcha task

func (*Client) HCaptchaProxyless

func (c *Client) HCaptchaProxyless(ctx context.Context, siteURL, siteKey string, opts ...OptionalValue) (result HCaptchaResult, err error)

HCaptchaProxyless submits and retrieves a hcaptcha task

func (*Client) ImageToText

func (c *Client) ImageToText(ctx context.Context, body string, opts ...OptionalValue) (result ImageCaptchaResult, err error)

ImageToText submits and retrieves an image task

func (*Client) RecaptchaV2

func (c *Client) RecaptchaV2(ctx context.Context, siteURL, siteKey, userAgent string, proxy *url.URL, opts ...OptionalValue) (result RecaptchaResult, err error)

RecaptchaV2 submits and retrieves a recaptcha v2 task

func (*Client) RecaptchaV2Enterprise

func (c *Client) RecaptchaV2Enterprise(ctx context.Context, siteURL, siteKey, userAgent string, proxy *url.URL, opts ...OptionalValue) (result RecaptchaResult, err error)

RecaptchaV2Enterprise submits and retrieves a recaptcha v2 enterprise task

func (*Client) RecaptchaV2EnterpriseProxyless

func (c *Client) RecaptchaV2EnterpriseProxyless(ctx context.Context, siteURL, siteKey string, opts ...OptionalValue) (result RecaptchaResult, err error)

RecaptchaV2EnterpriseProxyless submits and retrieves a recaptcha v2 enterprise task

func (*Client) RecaptchaV2Proxyless

func (c *Client) RecaptchaV2Proxyless(ctx context.Context, siteURL, siteKey string, opts ...OptionalValue) (result RecaptchaResult, err error)

RecaptchaV2Proxyless submits and retrieves a recaptcha v2 task

func (*Client) RecaptchaV3Enterprise

func (c *Client) RecaptchaV3Enterprise(ctx context.Context, siteURL, siteKey string, minScore float64, opts ...OptionalValue) (result RecaptchaResult, err error)

RecaptchaV3Enterprise submits and retrieves a recaptcha v3 enterprise task

func (*Client) RecaptchaV3Proxyless

func (c *Client) RecaptchaV3Proxyless(ctx context.Context, siteURL, siteKey string, minScore float64, opts ...OptionalValue) (result RecaptchaResult, err error)

RecaptchaV3Proxyless submits and retrieves a recaptcha v3 task

func (*Client) ReportIncorrectImageCaptcha

func (c *Client) ReportIncorrectImageCaptcha(ctx context.Context, taskId int64) (err error)

ReportIncorrectImageCaptcha reports an incorrect captcha for a refund

func (*Client) ReportIncorrectRecaptcha

func (c *Client) ReportIncorrectRecaptcha(ctx context.Context, taskId int64) (err error)

ReportIncorrectRecaptcha reports an incorrect captcha for a refund

func (*Client) SquareNet

func (c *Client) SquareNet(ctx context.Context, body, object string, rows, columns int64) (result SquareNetResult, err error)

SquareNet submits and retrieves a squarenet task

type ClientOption

type ClientOption func(c *Client)

ClientOption is an option used to modify the anti-captcha client

func WithCheckInterval

func WithCheckInterval(duration time.Duration) ClientOption

WithCheckInterval is an option that makes the Client use the provided check interval

func WithDelay

func WithDelay(duration time.Duration) ClientOption

WithDelay is an option that makes the Client use the provided delay

func WithHost

func WithHost(host string) ClientOption

WithHost is an option that makes the Client use the provided host

type FuncaptchaResult

type FuncaptchaResult struct {
	Token string `json:"token"`
}

FuncaptchaResult is the api response from a funcaptcha task

type GeeTestResult

type GeeTestResult struct {
	Challenge string `json:"challenge"`
	Validate  string `json:"validate"`
	SecCode   string `json:"seccode"`
}

GeeTestResult is the api response from a geetest task

type HCaptchaResult

type HCaptchaResult struct {
	GRecaptchaResponse string `json:"gRecaptchaResponse"`
}

HCaptchaResult is the api response from a hcaptcha task

type ImageCaptchaResult

type ImageCaptchaResult struct {
	Text string `json:"text"`
	URL  string `json:"url"`
}

ImageCaptchaResult is the api response from an image task

type OptionalValue

type OptionalValue func(map[string]interface{})

OptionalValue is an option used to add values to an api request

func WithOptional

func WithOptional(key string, value interface{}) OptionalValue

WithOptional is an option that adds values to an api request

type RecaptchaResult

type RecaptchaResult struct {
	GRecaptchaResponse string      `json:"gRecaptchaResponse"`
	Cookies            interface{} `json:"cookies"`
}

RecaptchaResult is the api response from a recaptcha task

type SquareNetResult

type SquareNetResult struct {
	CellNumbers []int64 `json:"cellNumbers"`
}

SquareNetResult is the api response from a squarenet task

Jump to

Keyboard shortcuts

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