Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/transitive-bullshit/captcha-solver

Library and CLI for automating captcha verification across multiple providers.
https://github.com/transitive-bullshit/captcha-solver

anti-captcha captcha captcha-solving nocaptcha recaptcha

Last synced: about 2 months ago
JSON representation

Library and CLI for automating captcha verification across multiple providers.

Awesome Lists containing this project

README

        

# captcha-solver

> Library and CLI for automating captcha verification across multiple providers.

[![NPM](https://img.shields.io/npm/v/captcha-solver.svg)](https://www.npmjs.com/package/captcha-solver) [![Build Status](https://travis-ci.com/transitive-bullshit/captcha-solver.svg?branch=master)](https://travis-ci.com/transitive-bullshit/captcha-solver) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)


Nocaptcha Recaptcha

## Status

This project is fully functional both as a [library](packages/captcha-solver) and [CLI](packages/captcha-solver-cli). We currently only support one captcha-solver-provider, powered by [anti-captcha](https://anti-captcha.com).

## Packages

- [captcha-solver](packages/captcha-solver) - Library for automating captcha verification.
- [captcha-solver-cli](packages/captcha-solver-cli) - CLI for automating captcha verification.
- [captcha-solver-provider](packages/captcha-solver-provider) - Abstract base class for captcha solver providers.
- [captcha-solver-provider-anti-captcha](packages/captcha-solver-provider-anti-captcha) - Captcha solver provider for the [anti-captcha](https://anti-captcha.com) service.
- [captcha-solver-provider-browser](packages/captcha-solver-provider-browser) - Captcha solver provider for a local, browser-based, manual solver.

## Usage

```bash
Usage: index [options] [command]

Options:

-V, --version output the version number
-k, --key API key for provider
-i, --image Path or url of image to solve
-t, --type Type of captcha to solve (default: image-to-text)
-u, --website-url Website URL for nocaptcha, recaptcha, and funcaptcha
-K, --website-key Recaptcha website key
-S, --website-s-token Optional secret token for old version of Recaptcha
--website-public-key Funcaptcha public key
--proxy-type Type of proxy to use
--proxy-address Proxy IP address ipv4/ipv6
--proxy-port Proxy port
--proxy-login Optional login for proxy which requires authorizaiton (basic)
--proxy-password Optional proxy password
-U, --user-agent Browser's User-Agent which is used in emulation.
-C, --cookies Optional additional cookies.
-P, --provider Provider to use (default: anti-captcha)
-h, --help output usage information

Commands:

create-task
get-task-result [options]
solve [options]
```

## API

#### Table of Contents

- [CaptchaSolver](#captchasolver)
- [provider](#provider)
- [createTask](#createtask)
- [getTaskResult](#gettaskresult)

### [CaptchaSolver](https://github.com/transitive-bullshit/captcha-solver/blob/ec5e0649a40d0489264905d80a991f071703fce2/packages/captcha-solver/index.js#L19-L128)

Main entrypoint for solving captchas.

Type: `function (provider, opts)`

- `provider` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | CaptchaSolverProvider)** Name of built-in provider or an instance of
a custom provider to use for solving.
- `opts` (optional, default `{}`)

* * *

#### [provider](https://github.com/transitive-bullshit/captcha-solver/blob/ec5e0649a40d0489264905d80a991f071703fce2/packages/captcha-solver/index.js#L33-L33)

Provider powering this solver.

Type: CaptchaSolverProvider

* * *

#### [createTask](https://github.com/transitive-bullshit/captcha-solver/blob/ec5e0649a40d0489264905d80a991f071703fce2/packages/captcha-solver/index.js#L70-L92)

Creates a new captcha solving task.

Valid values for `opts.type` are:

- image-to-text
- recaptcha
- recaptcha-proxyless
- nocaptcha
- nocaptcha-proxyless
- funcaptcha
- funcaptcha-proxyless

Note that not all providers support all captcha types. See
`provider.supportedTaskTypes` for a Set containing all task types a given
provider supports.

Note that most of these options will be unused depending on the task type.

Type: `function (opts)`

- `opts` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options
- `opts.type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Type of captcha to solve
- `opts.image` **([buffer](https://nodejs.org/api/buffer.html) \| [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))?** Path, URL, or buffer of an image to process
- `opts.websiteURL` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Website URL for nocaptcha, recaptcha, and funcaptcha
- `opts.websiteKey` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Recaptcha website key
- `opts.websiteSToken` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Secret token for old versions of Recaptcha
- `opts.websitePublicKey` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Funcaptcha public key
- `opts.proxyType` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Proxy type (http/socks4/socks5)
- `opts.proxyAddress` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Proxy IP address (ipv4/ipv6)
- `opts.proxyPort` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number))?** Proxy port
- `opts.proxyLogin` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Proxy login for basic auth
- `opts.proxyPassword` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Proxy password
- `opts.userAgent` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Browser's User-Agent to emulate
- `opts.cookies` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Additional cookies to emulate

* * *

#### [getTaskResult](https://github.com/transitive-bullshit/captcha-solver/blob/ec5e0649a40d0489264905d80a991f071703fce2/packages/captcha-solver/index.js#L104-L127)

Fetches the result of a previously created captcha solving task.

Type: `function (taskId, opts)`

- `taskId` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Unique task identifier
- `opts` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Options (optional, default `{}`)
- `opts.retries` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of retries to perform (optional, default `3`)
- `opts.timeout` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Max timeout to wait in ms before aborting (optional, default `30000`)

* * *

## Related

- [puppeteer](https://github.com/GoogleChrome/puppeteer) - Headless Chrome Node API used under the hood.
- [puppeteer-email](https://github.com/transitive-bullshit/puppeteer-email) - Email automation driven by headless chrome.
- [sms-number-verifier](https://github.com/transitive-bullshit/sms-number-verifier) - Allows you to spoof SMS number verification.
- [awesome-puppeteer](https://github.com/transitive-bullshit/awesome-puppeteer) - A curated list of awesome puppeteer resources.
- [python captcha solver](https://github.com/lorien/captcha_solver) - Similar to this module but in python.
- [recognize](https://github.com/kdinisv/Recognize) - Deprecated module with similar functionality to this module.

## Disclaimer

Using this software to violate the terms and conditions of any third-party service is strictly against the intent of this software. By using this software, you are acknowledging this fact and absolving the author or any potential liability or wrongdoing it may cause. This software is meant for testing and experimental purposes only, so please act responsibly.

## License

MIT © [Travis Fischer](https://github.com/transitive-bullshit)

Support my OSS work by following me on twitter twitter