Catalog npm
Back to packageRELEASE DETAILS

1.0.3

npm

2captcha-rucaptcha

Simple 2captcha and rucaptcha API wrapper for Node.js

2captcha2captcha.comrucaptcharucaptcha.com
Published3 Oct 2019
Direct dependencies7
Transitive dependenciesNot calculated

README

Current package documentation

Simple 2captcha and rucaptcha API wrapper for Node.js

npm version coverage build

The package is written in TypeScript and currently only supports base64 images.

Instalation

NPM:

npm i 2captcha-rucaptcha --save

Yarn:

yarn add 2captcha-rucaptcha

Usage

All examples are on the github.

Upload image to rucaptcha

const { Captcha } = require("2captcha-rucaptcha");
const fs = require("fs");

const captcha = new Captcha({
  type: 1,
  key: "<YOUR_API_KEY>"
});

const base64 = fs.readFileSync("base64.txt", "utf-8");
captcha
  .solve({ method: "base64", body: base64 })
  .then(result => {
    console.log(result);
  })
  .catch(e => {
    console.log(e);
  });

Upload image to 2captcha

const { Captcha } = require("2captcha-rucaptcha");
const fs = require("fs");

const captcha = new Captcha({
  type: 2,
  key: "<YOUR_API_KEY>"
});

const base64 = fs.readFileSync("base64.txt", "utf-8");
captcha
  .solve({ method: "base64", body: base64 })
  .then(result => {
    console.log(result);
  })
  .catch(e => {
    console.log(e);
  });

Available options to create an instance

NameRequiredDescription
type+1 - rucaptcha
2 - 2captcha
key+Your API key
delay-Delay before receiving a captcha recognition response in seconds
Default - 3s

Available options solve()

NameRequiredDescription
method+post (multipart form) or base64 (image base64 encode)
phrase-0 - captcha contains one word
1 - captcha contains two or more words
regsense-0 - captcha in not case sensitive
1 - captcha is case sensitive
numeric-0 - not specified
1 - captcha contains only numbers
2 - captcha contains only letters
3 - captcha contains only numbers OR only letters
4 - captcha contains both numbers AND letters
calc-0 - not specified
1 - captcha requires calculation (e.g. type the result 4 + 8 = )
min_len-0 - not specified
1..20 - minimal number of symbols in captcha
max_len-0 - not specified
1..20 - maximal number of symbols in captcha
language-0 - not specified
1 - Cyrillic captcha
2 - Latin captcha.
lang-ru, en and etc.
textinstructions-Text will be shown to worker to help him to solve the captcha correctly.
imginstructions-BASE64
Image will be shown to worker to help him to solve the captcha correctly.
pingback-URL for pingback (callback) response that will be sent when captcha is solved.
URL should be registered on the server.
header_acao-0 - disabled
1 - enabled.
If enabled in.php will include Access-Control-Allow-Origin:* header in the response.
Used for cross-domain AJAX requests in web applications.
softId-ID of software developer

Report bad and good

To report a failed or successful captcha solution, you need to use the following methods:

bad(id)
good(id)

Example:

solution = await captcha.solve({ method: "base64", body: base64, lang: "en", numeric: 1 });
if (ok) captcha.good(captcha.id);
else captcha.bad(captcha.id);

Proxy

Passed to the solve() along with the options above.

NameDescription
proxyFormat for IP authentication: IP_address:PORT
Example: proxy=123.123.123.123:3128
Format for login/password authentication: login:password@IP_address:PORT
Example: proxy=proxyuser:strongPassword@123.123.123.123:3128
proxytypeType of your proxy: HTTP, HTTPS, SOCKS4, SOCKS5.

Downloads & popularity

Awaiting observations

No metric observations yet

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

Declared dependencies 7

Native requirements
7 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^0.19.0runtime
delay
Environment
{
  "local_name": "delay",
  "alias": false,
  "peer_metadata": null
}
^4.3.0runtime
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^12.7.8development
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^8.4.1development
tslint
Environment
{
  "local_name": "tslint",
  "alias": false,
  "peer_metadata": null
}
^5.20.0development
tslint-config-airbnb
Environment
{
  "local_name": "tslint-config-airbnb",
  "alias": false,
  "peer_metadata": null
}
^5.11.2development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^3.6.3development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-1h0S2npsjBhVTKpHnITtWSPnUW1rTYAHFyOCfBX2s2ieC/2+7qyHaYXzrQZ5/jB/3+87NysmLkO6fMLY6lX0Pg==",
  "shasum": "c48c31c2962478904ded3919afee4e837c7736d4",
  "tarball": "https://registry.npmjs.org/2captcha-rucaptcha/-/2captcha-rucaptcha-1.0.3.tgz",
  "fileCount": 4,
  "unpackedSize": 25069,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlchTCRA9TVsSAnZWagAAe/QP/RKcHTQkb7IafyJkVFKg\nFTwbKHe0PgS+JQYx/aMwrCI7rslaaUxunr1g0/ab69svqCNjM5ClVgKLQYih\nfFteRQcfQgMXP9VvsvLAzUmaxdtIMYfDJGCkivKzRlacrn/rPplFGsw1Uc9w\nnoZHmasqR1v+KKby/WN+hJOj2bbxPu9CiEzMhhuKu/j3wSj4934mj2tvdKOC\nAq6sR7JYYELFKPpH2B+ZAbYTShonuPM1SEAFEeNpcCecemc8eRcCzsYd3/x3\nMptyjp6WFtIVAI72BbI2Cd74eqeFW59JPTfXx9SZgqZrWwTqIUMrxgsGgbH8\nOwmwFBIvQCgfX3sC/lxtL6Mrsxy2idacQeoiOP7ASij85Bx3iEjGMiT0mCVi\nb45fI8N/YdE0z2d5IF5WunKhXrrm6704djhpJ1VhXEhoo2S5FxmU5hArNN+J\nJFlatF7hcTTIdCgEVFp+qtQJ2tu/ASHUA/ounUKdWKFdQA7RC9IAcq7hP8Jo\nLrtxNBVMZRXFuibZ+cIXhE9Y1xM+zXT/w0MnMXJLsLLzPRMzHcugpDyBkl68\nfAnrcL4j0iXuclC0Hs/PSHjU9UBPrm4vLoPf0vszQ2XYXQiPLMirbLdUmgoj\n8MmaA8nAaZxrsO2mjhW334ibgKKQ4aFOPNJSe+kYfoPJzFs5a2Ozlaq3AyQs\nIHAq\r\n=e0uI\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIDspf2SNbxrRFcbKmyFITO598jB5gl2Q6n4VkxLqonktAiEAqekyUHGZfQtlWrETGJEq5Iz8OLTh59YrtmpbQR4EBBE="
    }
  ]
}

Repository

PENDING
deone4eg/2captcha-rucaptcha

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:11b5efd7affeb8f6ed3c16a5ef0998dbff6527659e2c9e4dafd8cb43648cf654

Other collected versions

1.1.76 Oct1.1.65 Oct1.1.53 Oct1.1.43 Oct1.1.33 Oct1.1.13 OctView all collected versions →