All Projects → 2captcha → 2captcha-go

2captcha / 2captcha-go

Licence: other
Golang Module for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to 2captcha-go

2captcha-php
PHP package for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.
Stars: ✭ 25 (-19.35%)
Mutual labels:  recaptcha, captcha, captcha-solving, captcha-breaking, geetest, anticaptcha, recaptcha-v2, hcaptcha, recaptcha-v3, clickcaptcha, rotatecaptcha, funcaptcha, keycaptcha, arkoselabs
2captcha-python
Python 3 package for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.
Stars: ✭ 140 (+351.61%)
Mutual labels:  recaptcha, captcha, captcha-solving, captcha-breaking, geetest, anticaptcha, recaptcha-v2, hcaptcha, recaptcha-v3, clickcaptcha, rotatecaptcha, funcaptcha, keycaptcha, arkoselabs
dcat-auth-captcha
Sliding captcha for dcat-admin auth / dcat-admin登陆 滑动验证插件 多平台支持
Stars: ✭ 38 (+22.58%)
Mutual labels:  recaptcha, captcha, geetest, hcaptcha
go-captcha
Go Captcha is a behavioral captcha, which implements the generation of random verification text and the verification of click position information.
Stars: ✭ 86 (+177.42%)
Mutual labels:  captcha, clickcaptcha, funcaptcha, keycaptcha
Captcha-Tools
All-in-one Python (And now Go!) module to help solve captchas with Capmonster, 2captcha and Anticaptcha API's!
Stars: ✭ 23 (-25.81%)
Mutual labels:  recaptcha, captcha, hcaptcha
TikTokBot
Bot save videos from instagram and then post them to Tik-Tok
Stars: ✭ 21 (-32.26%)
Mutual labels:  captcha, captcha-solving, captcha-breaking
simple-recaptcha-v3
🤖 This repository contains simple reCAPTCHA v3 integration for your Laravel application.
Stars: ✭ 25 (-19.35%)
Mutual labels:  recaptcha, captcha, recaptcha-v3
Buster
Captcha solver extension for humans
Stars: ✭ 4,244 (+13590.32%)
Mutual labels:  recaptcha, captcha, captcha-solving
captcha-solver
Library and CLI for automating captcha verification across multiple providers.
Stars: ✭ 101 (+225.81%)
Mutual labels:  recaptcha, captcha, captcha-solving
rotate-captcha
Rotate image captcha,旋转图片验证码
Stars: ✭ 50 (+61.29%)
Mutual labels:  captcha, rotatecaptcha
ulozto-captcha-breaker
Deep learning model using Tensorflow that breaks ulozto captcha codes.
Stars: ✭ 65 (+109.68%)
Mutual labels:  captcha, captcha-breaking
PRRecaptchaBundle
Recaptcha v3 bundle for Symfony
Stars: ✭ 14 (-54.84%)
Mutual labels:  recaptcha, recaptcha-v3
Captcha solver
Universal python API to captcha solving services
Stars: ✭ 152 (+390.32%)
Mutual labels:  recaptcha, captcha
Recaptcha
ReCaptcha helpers for ruby apps
Stars: ✭ 1,819 (+5767.74%)
Mutual labels:  recaptcha, captcha
Recaptcha Module
🤖 Simple and easy Google reCAPTCHA integration with Nuxt.js
Stars: ✭ 143 (+361.29%)
Mutual labels:  recaptcha, captcha
Python Anticaptcha
Client library for solve captchas with Anticaptcha.com support.
Stars: ✭ 137 (+341.94%)
Mutual labels:  recaptcha, captcha
react-recaptcha-x
a React reCAPTCHA version 3 and version 2 (checkbox) component in one.
Stars: ✭ 21 (-32.26%)
Mutual labels:  recaptcha, recaptcha-v3
imagetyperz-api-python3
imagetyperz-api-python3 - is a super easy to use bypass captcha API wrapper for imagetyperz.com captcha service
Stars: ✭ 25 (-19.35%)
Mutual labels:  captcha, anticaptcha
wp-recaptcha-integration
WordPress reCaptcha integration supporting Ninja Forms and Contact Form 7
Stars: ✭ 50 (+61.29%)
Mutual labels:  recaptcha, captcha
opensea automatic uploader
(Bypass reCAPTCHAs) A Selenium Python bot to automatically and bulky upload and list your NFTs on OpenSea (all metadata integrated - Ethereum and Polygon supported); reCAPTCHA solver & bypasser included.
Stars: ✭ 205 (+561.29%)
Mutual labels:  recaptcha, captcha

Golang Module for 2Captcha API

The easiest way to quickly integrate 2Captcha into your code to automate solving of any type of captcha.

Installation

To install the api client, use this:

go get -u github.com/2captcha/2captcha-go

Configuration

Import the module like this:

import (
        "github.com/2captcha/2captcha-go"
)

Client instance can be created like this:

client := api2captcha.NewClient("YOUR_API_KEY")

There are few options that can be configured:

client.SoftId = 123
client.Callback = "https://your.site/result-receiver"
client.DefaultTimeout = 120
client.RecaptchaTimeout = 600
client.PollingInterval = 100

Client instance options

Option Default value Description
soft_id - your software ID obtained after publishing in 2captcha sofware catalog
callback - URL of your web-sever that receives the captcha recognition result. The URl should be first registered in pingback settings of your account
default_timeout 120 Timeout in seconds for all captcha types except ReCaptcha. Defines how long the module tries to get the answer from res.php API endpoint
recaptcha_timeout 600 Timeout for ReCaptcha in seconds. Defines how long the module tries to get the answer from res.php API endpoint
polling_interval 10 Interval in seconds between requests to res.php API endpoint, setting values less than 5 seconds is not recommended

IMPORTANT: once callback URL is defined for client instance, all methods return only the captcha ID and DO NOT poll the API to get the result. The result will be sent to the callback URL. To get the answer manually use GetResult method

Solve captcha

When you submit any image-based captcha use can provide additional options to help 2captcha workers to solve it properly.

Captcha options

Option Default Value Description
numeric 0 Defines if captcha contains numeric or other symbols see more info in the API docs
min_len 0 minimal answer lenght
max_len 0 maximum answer length
phrase 0 defines if the answer contains multiple words or not
case_sensitive 0 defines if the answer is case sensitive
calc 0 defines captcha requires calculation
lang - defines the captcha language, see the list of supported languages
hint_img - an image with hint shown to workers with the captcha
hint_text - hint or task text shown to workers with the captcha

Below you can find basic examples for every captcha type, check out the code below.

Basic example

Example below shows a basic solver call example with error handling.

cap := api2captcha.Normal{
   File: "/path/to/normal.jpg",
}

code, err := client.Solve(cap.ToRequest())
if err != nil {
	if err == api2captcha.ErrTimeout {
		log.Fatal("Timeout");
	} else if err == api2captcha.ErrApi {
		log.Fatal("API error");
	} else if err == api2captcha.ErrNetwork {
		log.Fatal("Network error");
	} else {
		log.Fatal(err);
	}
}
fmt.Println("code "+code)

Normal Captcha

To bypass a normal captcha (distorted text on image) use the following method. This method also can be used to recognize any text on the image.

cap := api2captcha.Normal{
   File: "/path/to/normal.jpg",
   Numeric: 4,
   MinLen: 4,
   MaxLen: 20,
   Phrase: true,
   CaseSensitive: true,
   Lang: "en",
   HintImgFile: "/path/to/hint.jpg",
   HintText: "Type red symbols",
}

Text Captcha

This method can be used to bypass a captcha that requires to answer a question provided in clear text.

cap := api2captcha.Text{
   Text: "If tomorrow is Saturday, what day is today?",
   Lang: "en",
}

ReCaptcha v2

Use this method to solve ReCaptcha V2 and obtain a token to bypass the protection.

cap := api2captcha.ReCaptcha{
   SiteKey: "6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-",
   Url: "https://mysite.com/page/with/recaptcha",
   Invisible: true,
   Action: "verify",
}
req := cap.ToRequest()
req.SetProxy("HTTPS", "login:password@IP_address:PORT")
code, err := client.solve(req)

ReCaptcha v3

This method provides ReCaptcha V3 solver and returns a token.

cap := api2captcha.ReCaptcha{
   SiteKey: "6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-",
   Url: "https://mysite.com/page/with/recaptcha",
   Version: "v3",
   Action: "verify",
   Score: 0.3,
}
req := cap.ToRequest()
req.SetProxy("HTTPS", "login:password@IP_address:PORT")
code, err := client.solve(req)

FunCaptcha

FunCaptcha (Arkoselabs) solving method. Returns a token.

cap := api2captcha.FunCaptcha{
   SiteKey: "69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC",
   Url: "https://mysite.com/page/with/funcaptcha",
   Surl: "https://client-api.arkoselabs.com",
   UserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36",
   Data: map[string]string{"anyKey":"anyValue"},   
}
req := cap.ToRequest()
req.SetProxy("HTTPS", "login:password@IP_address:PORT")
code, err := client.solve(req)

GeeTest

Method to solve GeeTest puzzle captcha. Returns a set of tokens as JSON.

cap := api2captcha.GeeTest{
   GT: "f2ae6cadcf7886856696502e1d55e00c",
   ApiServer: "api-na.geetest.com",
   Challenge: "12345678abc90123d45678ef90123a456b",
   Url: "https://mysite.com/captcha.html",
}
req := cap.ToRequest()
req.SetProxy("HTTPS", "login:password@IP_address:PORT")
code, err := client.solve(req)

hCaptcha

Method to solve GeeTest puzzle captcha. Returns a set of tokens as JSON.

cap := api2captcha.HCaptcha{
   SiteKey: "10000000-ffff-ffff-ffff-000000000001",
   Url: "https://mysite.com/captcha.html",   
}
req := cap.ToRequest()
req.SetProxy("HTTPS", "login:password@IP_address:PORT")
code, err := client.solve(req)

KeyCaptcha

Token-based method to solve KeyCaptcha.

cap := api2captcha.KeyCaptcha{
   UserId: 10,
   SessionId: "493e52c37c10c2bcdf4a00cbc9ccd1e8",
   WebServerSign: "9006dc725760858e4c0715b835472f22",
   WebServerSign2: "9006dc725760858e4c0715b835472f22",
   Url: "https://www.keycaptcha.ru/demo-magnetic/",   
}
req := cap.ToRequest()
req.SetProxy("HTTPS", "login:password@IP_address:PORT")
code, err := client.solve(req)

Capy

Token-based method to bypass Capy puzzle captcha.

cap := api2captcha.Capy{
   SiteKey: "PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v",
   Url: "https://www.mysite.com/captcha/",   
}
req := cap.ToRequest()
req.SetProxy("HTTPS", "login:password@IP_address:PORT")
code, err := client.solve(req)

Grid

Grid method is originally called Old ReCaptcha V2 method. The method can be used to bypass any type of captcha where you can apply a grid on image and need to click specific grid boxes. Returns numbers of boxes.

cap := api2captcha.Grid{
    File: "path/to/captcha.jpg",
    Rows: 3,
    Cols: 3,
    PreviousId: 0,
    CanSkip: false,
    Lang: "en",
    HintImageFile: "path/to/hint.jpg",
    HintText: "Select all images with an Orange",
}

Canvas

Canvas method can be used when you need to draw a line around an object on image. Returns a set of points' coordinates to draw a polygon.

cap := api2captcha.Canvas{
    File: "path/to/captcha.jpg",
    PreviousId: 0,
    CanSkip: false,
    Lang: "en",
    HintImageFile: "path/to/hint.jpg",
    HintText: "Draw around apple",
}

ClickCaptcha

ClickCaptcha method returns coordinates of points on captcha image. Can be used if you need to click on particular points on the image.

cap := api2captcha.Coordinates{
    File: "path/to/captcha.jpg",
    Lang: "en",
    HintImageFile: "path/to/hint.jpg",
    HintText: "Connect the dots",
}

Rotate

This method can be used to solve a captcha that asks to rotate an object. Mostly used to bypass FunCaptcha. Returns the rotation angle.

cap := api2captcha.Rotate{
    File: "path/to/captcha.jpg",
    Angle: 40,
    Lang: "en",
    HintImageFile: "path/to/hint.jpg",
    HintText: "Put the images in the correct way",
}

Other methods

Send / GetResult

These methods can be used for manual captcha submission and answer polling.

id, err := client.Send(cap.ToRequest())
if err != nil {
   log.Fatal(err);
}

time.Sleep(10 * time.Second)

code, err := client.GetResult(id)
if err != nil {
   log.Fatal(err);
}

if code == nil {
   log.Fatal("Not ready")
}
	
fmt.Println("code "+*code)	

balance

Use this method to get your account's balance

balance, err := client.GetBalance()
if err != nil {
   log.Fatal(err);
}

report

Use this method to report good or bad captcha answer.

err := client.Report(id, true) // solved correctly
err := client.Report(id, false) // solved incorrectly
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].