Coder Social home page Coder Social logo

kpabellan / 2captcha-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 2captcha/2captcha-go

1.0 0.0 0.0 24 KB

Golang Module for easy integration with the API of 2captcha captcha solving service to bypass recaptcha.

Home Page: https://2captcha.com

Go 100.00%

2captcha-go's Introduction

Golang Module for 2Captcha API

The easiest way to quickly integrate [2Captcha] into your code.

Installation

To install the api client, use this:

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

Configuration

Import the module like this:

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

Client instance can be created like this:

client := api2captcha.NewClient("YOUR_API_KEY")

There are few options that can be configured:

client.RecaptchaTimeout = 600
client.PollingInterval = 10

Client instance options

Option Default value Description
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

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)

Other methods

Balance

Use this method to get your account's balance

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

2captcha-go's People

Contributors

brugeman avatar kpabellan avatar uwynell avatar

Stargazers

Jacob Duncan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.