2captcha-rucaptcha v1.1.7

CAPTCHAFORUM

Administrator
1651077692722.png

Simple 2captcha and rucaptcha API wrapper for Node.js

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
Code:
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
Code:
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);
  });

Documentation https://npm.io/package/2captcha-rucaptcha