Giter Site home page Giter Site logo

louisbillaut / capmonstertool Goto Github PK

View Code? Open in Web Editor NEW
24.0 1.0 2.0 15 KB

CapMonsterTool is a set of Go tools designed to simply make requests to the CapMonster Cloud API.

License: MIT License

Go 100.00%
capmonster-cloud capmonster-api captcha-solver captcha-solving capmonster capmonstercloud captcha go golang

capmonstertool's Introduction

✨ CapMonsterTool ✨

About this module

What is ✨ CapMonsterTool ✨ ?

CapMonsterTool is a set of Go tools designed to simply make requests to the CapMonster Cloud API. You need a CapMonster Cloud account to use this module. This API allows you to resolve captcha.

Developed with

CapMonster Cloud API documentation

CapMonster Cloud API documentation is available at this url.
I strongly advise to read this documentation before using the module

Captcha Solvers

Capsolver's Banner

Supporting all common and well known captcha types and a success rate of over 99%, CapSolver allows for affordable AI-based captcha solving with JS/TS clients as well as HTTP support. Their packages are extremely affordable for projects of any size, offering a free trial to test out their service.

Getting started

import the module

The easiest way to use ths module is to import it:

import (
	"github.com/LouisBillaut/capMonsterTool"
)

main API endpoints

There are 3 main API endpoint to CapMonster API:

Examples

The examples/ folder contains some examples of use of this module.
Please note that before run example, put your own API key in apiKey field.

Get account Balance

balance, err := capMonsterTool.GetBalance(apiKey)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Println(balance)

Create a task

Start by create a Task type. All possible tasks type here.
Here is some simple examples:

task1 := NoCaptchaTaskProxyless{Type: "NoCaptchaTaskProxyless", WebsiteURL: myUrl, WebsiteKey: myWebsiteKey}
task2 := ImageToTextTask{Type: "ImageToTextTask", Body: body, CapMonsterModule: "yandex"}

Your can now create a Task:

taskId1, err := capMonsterTool.CreateTask(apiKey, task1)
if err != nil {
	fmt.Println(err)
	return
}

taskId2, err := capMonsterTool.CreateTaskWithCallbackUrl(apiKey, task2, myCallbackUrl)
if err != nil {
    fmt.Println(err)
    return
}

Retrieve Task result

⚠️ Please note that calling GetTaskResult does not ensure you have an immediate captcha solution, if the CapMonsterProcessing error is thrown, try again

captchaRes, err := capMonsterTool.GetTaskResult(apiKey, taskId)
for err != nil {
	if !errors.Is(capMonsterTool.CapMonsterProcessing{}, err) {
		fmt.Println(err)
		return
	}
	fmt.Println("task is processing...")
	time.Sleep(2 * time.Second)
	captchaRes, err = capMonsterTool.GetTaskResult(apiKey, taskId)
}
fmt.Println(captchaRes)

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.