Catalog npm
Back to packageRELEASE DETAILS

1.1.1

npm

2captcha-wrapper

A module to solve google's recaptcha v2 using the 2captcha service.

2captchabypasscaptchagooglerecaptcha
Published8 Feb 2020
Direct dependencies0
Transitive dependenciesNot calculated

README

Current package documentation

NODE.js 2captcha wrapper

This is a node.js module for solving google's recaptcha v2 using the 2captcha service.

Installation

npm install 2captcha-wrapper

Usage

You will need a 2captcha api key, which you can get here.

The module exports the TwoCaptcha prototype. It accepts two parameters on construction: apiKey and timeout, the timeout parameter can be ommited, defaulting to 180000 milliseconds;

The object contains the solve method that should be used to get the captcha id/token for google recaptcha.

The solve method, when successful, returns an object containing the request id and token. On failure it returns null and reports the bad captcha.

After getting the token, you can send it with your http request or set it in the page if you're running puppeteer/selenium.

The id can be used to report good/bad captcha using the reportGood/reportBad methods.

To get the siteKey: Open the webpage, view source, ctrl+f "data-sitekey".

  TwoCaptcha = require('2captcha-wrapper');

  const apiKey = '123tyg231yg123v32g123u'; //Your 2captcha api key
  const captchaTimeout = 180000; //The maximum amount of time (ms) to wait for the captcha to be solved.

  const siteCaptcha = {
    siteKey: 'uadsuadsuyasduvsduv', //The url's siteKey
    url: 'www.example.com', //The url in which the captcha appears
    invisible: false, //Whether or not the captcha is invisible
  }

  async function main() {
    var tcaptcha = new TwoCaptcha(apiKey, captchaTimeout);
    var captchaToken = await tcaptcha.solve(siteCaptcha);
    console.log('Got token!');
    console.log(captchaToken);
  }

  main();

Author

Ícaro Augusto

Changelogs

1.0.0

Created.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 0

Native requirements
0 direct targetsNot calculated transitive count
No declared dependencies in this collected response

Declarations describe requirements; they are not a resolved dependency graph.

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-A4ioQvWwEX+9VuP1D0HdZI5UXw5ir7x4vkPWAq2rTnGgAfYCstHJzG1ovlx43VKfw46My0LIv3MWnk5dAXomLw==",
  "shasum": "d6cddbc522a9968c60b776099e697140ee082b47",
  "tarball": "https://registry.npmjs.org/2captcha-wrapper/-/2captcha-wrapper-1.1.1.tgz",
  "fileCount": 3,
  "unpackedSize": 4825,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePvaxCRA9TVsSAnZWagAARrYP/1z7EV0uqfQC2DfUjEHi\nXBtoT2lsY1n/3oNeso9BL3IboY7hTM9xjJdZAB6IbY7oSxXr4U6SnVmIS5Sw\n4FL/dJP0Nc+Y5+MlYDbvIxezIBwVtW/i1XMhlYy9A27gMcL28DI1KsqRT1Gf\nUVIb50AKXrhC9J9HkmeCzqFa2LMgFIqR6uRMe1N3t0exQ26XxUfAHQh7RVqK\nJkSo+kyPteWGm6E+yJu5N8LG9ypEvJt6w5744bubbDOGhJ6UhgZDfu6eerQc\nS9AbYB8Cqe85u0YhICJrkuGKXHaqHnV/hssRep/fIZjwirqcm10fpVh0Rhns\n/m73RtxnaYlhw6OLSbTxw4v5Y4P+/6fkkflmI2I7iO2/WO/zcz+on8p1HNyH\nstH4Q8nvTjausgn31VjVXP7ysSD91QS9l+yalWcC7T5HFe8snJCIGDsSEdhu\nN2RiMXQacHdMl2SWMf4un2dp4ShZr1h1DESOzHMe2MedKSu4IlAee8nemo1z\nX0pF2a2uoyZoWCHxvxio6oxYhYWv+tMSUn5Z5gN5yVcbkumzoAPLUpkN7+yB\n+h/yUsol7A6ryAS5eH6sYEmK67UKnt2hhtaEChRceUhnfndzNOqWXqONHEw1\ntpagPM+jG4XMmwT1/UOyrFvpuZT8oUDs3/DxeQ5UMf4ZsENK5pFlmM4iRSMT\np+oz\r\n=nvDn\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQCDEApRopR+K3oIygP15pIz+iBSwnPnnIwZHOYHfH1eZwIhAIRmrnGqkiAppVgc/4trT3fZjy/VoC9AB7EqXzNLruOR"
    }
  ]
}

Repository

PENDING
icaroaugusto/2captcha-wrapper

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:09 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:fcfdf11f731bc921678e047a3986b930f7329295fb33ab4fd4eae548e416534f

Other collected versions

1.1.08 Feb1.0.17 Feb1.0.07 FebView all collected versions →