{"id":37116810,"url":"https://github.com/bask058/godbc","last_synced_at":"2026-01-14T13:41:09.130Z","repository":{"id":42045776,"uuid":"145675369","full_name":"bask058/godbc","owner":"bask058","description":"Golang DeathByCaptcha API","archived":false,"fork":false,"pushed_at":"2022-04-15T19:20:38.000Z","size":19,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-06-19T16:46:46.615Z","etag":null,"topics":["captcha-solving","deathbycaptcha-api","recaptcha-v2-captcha-solver"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bask058.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-22T07:51:19.000Z","updated_at":"2024-06-19T16:46:46.616Z","dependencies_parsed_at":"2022-08-12T03:20:17.023Z","dependency_job_id":null,"html_url":"https://github.com/bask058/godbc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bask058/godbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bask058%2Fgodbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bask058%2Fgodbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bask058%2Fgodbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bask058%2Fgodbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bask058","download_url":"https://codeload.github.com/bask058/godbc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bask058%2Fgodbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captcha-solving","deathbycaptcha-api","recaptcha-v2-captcha-solver"],"created_at":"2026-01-14T13:41:08.467Z","updated_at":"2026-01-14T13:41:09.114Z","avatar_url":"https://github.com/bask058.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# godbc\n--\n    import \".\"\n\nPackage godbc implements deathbycaptcha's HTTP API and ReCaptcha by Token API\n\nExample:\n```go\n    client := DefaultClient(`user`, `password`)\n\n    status, err := client.Status()\n    if err != nil {\n        panic(err)\n    }\n    if status.IsServiceOverloaded {\n        fmt.Println(\"Service is overloaded, this may fail\")\n    }\n\n    user, err := client.User()\n    if err != nil {\n        panic(err)\n    }\n    if user.IsBanned || !user.HasCreditLeft() {\n        panic(\"User is banned or no credit left\")\n    }\n\n    res, err := client.CaptchaFromFile(`./captcha.jpg`)\n    if err != nil {\n        panic(err)\n    }\n    resolved, err := client.WaitCaptcha(res)\n    if err != nil {\n        panic(err)\n    }\n\n    fmt.Printf(\"Captcha text: %s\\n\", resolved.Text)\n\n    ressource, err := client.RecaptchaWithoutProxy(`http://test.com/path_with_recaptcha`, `6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-`)\n    resolved, err = client.WaitCaptcha(ressource)\n    if err != nil {\n        panic(err)\n    }\n    fmt.Printf(\"Captcha token: %s\\n\", resolved.Text)\n```\n\n## Usage\n\n```go\nconst (\n\t//RecaptchaProxyTypeHTTP - HTTP proxy type\n\tRecaptchaProxyTypeHTTP = \"HTTP\"\n)\n```\nRecaptcha by token proxy types\n\n```go\nvar (\n\t//ErrCredentialsRejected - Credentials were rejected by service\n\tErrCredentialsRejected = errors.New(\"Credentials were rejected\")\n\t//ErrInvalidFormat - Only image formats accepted are JPG, PNG, GIF, BMP\n\tErrInvalidFormat = errors.New(\"Content is not in an accepted format (JPG, PNG, GIF, BMP)\")\n\t//ErrContentTooBig - As we use raw data, the size limit for an image is 180KB. With b64 encoded data, the limit woulf be 120KB\n\tErrContentTooBig = errors.New(\"Content is too big (180KB max)\")\n\t//ErrCaptchaTimeout - The captcha was not resolved under a good amount of time - give up\n\tErrCaptchaTimeout = errors.New(\"Captcha query has timed out\")\n\t//ErrCaptchaRejected - The server did reject the image data, as not being a valid image\n\tErrCaptchaRejected = errors.New(\"Captcha was rejected - not a valid image\")\n\t//ErrCaptchaInvalid - The captcha was not correctly solved\n\tErrCaptchaInvalid = errors.New(\"Captcha is invalid\")\n\t//ErrUnexpectedServerError - An unexpected error occured on the server side\n\tErrUnexpectedServerError = errors.New(\"Unexpected error on server side\")\n\t//ErrUnexpectedServerResponse - We got an unexpected response from the server\n\tErrUnexpectedServerResponse = errors.New(\"Unexpected output from server\")\n\t//ErrOverloadedServer - Server is overloaded and cannot take our query\n\tErrOverloadedServer = errors.New(\"Server is overloaded - try again later\")\n\t//ErrReportRejected - Our captcha reporting was rejected, either the captcha id is incorrect, our user is banned or we are reporting it too late (1 hour max)\n\tErrReportRejected = errors.New(\"Report was rejected - Bad captcha id, user banned or captcha too old (1h max)\")\n\t//ErrCaptchaDoesNotExist - The captcha id provided is non-existent\n\tErrCaptchaDoesNotExist = errors.New(\"Captcha does not exist\")\n)\n```\nError codes returned by failures to do API calls\n\n#### type CaptchaResponse\n\n```go\ntype CaptchaResponse struct {\n\tID        int64  `json:\"captcha\"`\n\tIsCorrect bool   `json:\"is_correct\"`\n\tText      string `json:\"text\"`\n\tStatus    int    `json:\"status\"`\n\tError     string `json:\"error\"`\n}\n```\n\nCaptchaResponse is returned as API response for all captcha related calls\n\n#### type Client\n\n```go\ntype Client struct {\n\tHTTPClient *http.Client\n}\n```\n\nClient is the DBC client main struct\n\n#### func  DefaultClient\n\n```go\nfunc DefaultClient(username, password string) *Client\n```\nDefaultClient returns a DBC client with default options:\n\n    Endpoint: http://api.dbcapi.me/api/\n    HttpTimeout: 30 seconds\n    TLSHandshakeTimeout: 5 seconds\n    CaptchaRetries: 10\n\n#### func  NewClient\n\n```go\nfunc NewClient(username, password string, options *ClientOptions) *Client\n```\nNewClient returns a DBC client. Options not specified will take default values,\nsee DefaultClient\n\n#### func (*Client) Captcha\n\n```go\nfunc (c *Client) Captcha(content []byte) (*CaptchaResponse, error)\n```\nCaptcha will make a captcha call from a byte slice\n\n#### func (*Client) CaptchaFromFile\n\n```go\nfunc (c *Client) CaptchaFromFile(filepath string) (*CaptchaResponse, error)\n```\nCaptchaFromFile will make a captcha call from a file on disk\n\n#### func (*Client) CaptchaFromHTTPRequest\n\n```go\nfunc (c *Client) CaptchaFromHTTPRequest(request *http.Request) (*CaptchaResponse, error)\n```\nCaptchaFromHTTPRequest will make a captcha call from an http request\n\n#### func (*Client) CaptchaFromURL\n\n```go\nfunc (c *Client) CaptchaFromURL(url string) (*CaptchaResponse, error)\n```\nCaptchaFromURL will make a captcha call from an image url\n\n#### func (*Client) PollCaptcha\n\n```go\nfunc (c *Client) PollCaptcha(ressource *CaptchaResponse) (*CaptchaResponse, error)\n```\nPollCaptcha will make a captcha poll call\n\n#### func (*Client) Recaptcha\n\n```go\nfunc (c *Client) Recaptcha(pageurl, googlekey, proxy, proxyType string) (*CaptchaResponse, error)\n```\nRecaptcha will make a recaptcha by token call\n\n    pageurl: the url of the webpage with the challenge\n    googlekey: the google data-sitekey token\n    proxy: address of the proxy\n    proxyType: type of the proxy\n\n#### func (*Client) RecaptchaWithoutProxy\n\n```go\nfunc (c *Client) RecaptchaWithoutProxy(pageurl, googlekey string) (*CaptchaResponse, error)\n```\nRecaptchaWithoutProxy will make a recaptcha by token call, without providing a\nproxy\n\n    pageurl: the url of the webpage with the challenge\n    googlekey: the google data-sitekey token\n\n#### func (*Client) ReportCaptcha\n\n```go\nfunc (c *Client) ReportCaptcha(ressource *CaptchaResponse) (*CaptchaResponse, error)\n```\nReportCaptcha will report a captcha as incorrectly solved\n\n#### func (*Client) Status\n\n```go\nfunc (c *Client) Status() (*StatusResponse, error)\n```\nStatus will retrieve status information\n\n#### func (*Client) User\n\n```go\nfunc (c *Client) User() (*UserResponse, error)\n```\nUser will retrieve user information\n\n#### func (*Client) WaitCaptcha\n\n```go\nfunc (c *Client) WaitCaptcha(ressource *CaptchaResponse) (*CaptchaResponse, error)\n```\nWaitCaptcha will wait for a captcha to be solved\n\n#### type ClientOptions\n\n```go\ntype ClientOptions struct {\n\tEndpoint            *url.URL\n\tHTTPTimeout         *time.Duration\n\tTLSHandshakeTimeout *time.Duration\n\tCaptchaRetries      int\n}\n```\n\nClientOptions is the client's options struct to be sent in the constructor\n\n#### type RecaptchaRequestPayload\n\n```go\ntype RecaptchaRequestPayload struct {\n\tPageURL   string `json:\"pageurl\"`\n\tGoogleKey string `json:\"googlekey\"`\n\tProxy     string `json:\"proxy,omitempty\"`\n\tProxyType string `json:\"proxytype,omitempty\"`\n}\n```\n\nRecaptchaRequestPayload is a payload that goes in a request for recaptcha by\ntoken api\n\n#### type StatusResponse\n\n```go\ntype StatusResponse struct {\n\tTodaysAccuracy      float64 `json:\"todays_accuracy\"`\n\tSolvedIn            float64 `json:\"solved_in\"`\n\tIsServiceOverloaded bool    `json:\"is_service_overloaded\"`\n\tStatus              int     `json:\"status\"`\n\tError               string  `json:\"error\"`\n}\n```\n\nStatusResponse is returned as API response for the `status` call\n\n#### type UserResponse\n\n```go\ntype UserResponse struct {\n\tID       int64   `json:\"user\"`\n\tRate     float64 `json:\"rate\"`\n\tBalance  float64 `json:\"balance\"`\n\tIsBanned bool    `json:\"is_banned\"`\n\tStatus   int     `json:\"status\"`\n\tError    string  `json:\"error\"`\n}\n```\n\nUserResponse is returned as API response for the `user` call\n\n#### func (*UserResponse) HasCreditLeft\n\n```go\nfunc (u *UserResponse) HasCreditLeft() bool\n```\nHasCreditLeft returns true is user has enough credit to solve one captcha\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbask058%2Fgodbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbask058%2Fgodbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbask058%2Fgodbc/lists"}