godbc

package module
v0.0.0-...-4e92234 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: MIT Imports: 8 Imported by: 1

README

go-dbc

Deathbycaptcha API written in Go for recaptcha v2

Installation

go get -u github.com/Zeroeh/go-dbc

Usage

Refer to example/example.go for usage and examples.

Notes

This is only intended for recaptcha v2 tokens, and not for images. I was pressed for time when making this so there is certainly room for improvements.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptchaClient

type CaptchaClient struct {
	Username   string
	Password   string
	SiteKey    string
	SiteURL    string
	Proxy      string
	ProxyType  string
	JSONString string
	Timeout    uint8 //180 is the max
	PollRate   int8  //5 seconds
	LastStatus CaptchaStatus
}

CaptchaClient is used to send captcha to DBC servers

func (*CaptchaClient) Decode

func (c *CaptchaClient) Decode(timeout uint8) (int, error)

Decode sends the captcha to dbc servers

func (*CaptchaClient) GetText

func (c *CaptchaClient) GetText() string

GetText returns the text from the captcha

func (*CaptchaClient) ParamToString

func (c *CaptchaClient) ParamToString()

ParamToString turns variables into hardcoded json string. DBC hires cheap coders, gets cheap programs... and it's a pain to accomodate

func (*CaptchaClient) PollCaptcha

func (c *CaptchaClient) PollCaptcha(id int) error

PollCaptcha keeps sending a get request to dbc for updated captcha results

func (*CaptchaClient) UpdatePollRate

func (c *CaptchaClient) UpdatePollRate(rate int8) error

UpdatePollRate updates the polling rate

func (*CaptchaClient) UpdateProxy

func (c *CaptchaClient) UpdateProxy(proxy string)

UpdateProxy updates the currently set proxy in the captcha client

func (*CaptchaClient) UpdateURL

func (c *CaptchaClient) UpdateURL(url string)

UpdateURL is used for registration pages that may have account-based parameters in their fields

type CaptchaStatus

type CaptchaStatus struct {
	Status    string
	CaptchaID string
	IsCorrect string
	Text      string
}

CaptchaStatus is the struct returned when polling a captchas status

type CaptchaStatusReal

type CaptchaStatusReal struct {
	Status    int    `json:"status"`
	CaptchaID int    `json:"captcha"`
	IsCorrect bool   `json:"is_correct"`
	Text      string `json:"text"`
}

CaptchaStatusReal is the actual json response when uploading captchas

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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