Skip to content

Latest commit

 

History

History
256 lines (179 loc) · 6.25 KB

readme.md

File metadata and controls

256 lines (179 loc) · 6.25 KB

Death by Captcha HTTP and Socket API clients.

node-lts (scoped) node-current

Solve and bypass All kind of captcha :

  1. Normal image captcha

  2. Text Captcha

  3. reCAPTCHA Coordinates

  4. reCAPTCHA Image Group

  5. reCAPTCHA V2

  6. reCAPTCHA V3

  7. Amazon WAF

  8. HCAPTCHA

  9. Audio Captcha

  10. Capy Captcha

  11. Fun Captcha

  12. Geetest CAPTCHA V3

  13. Geetest CAPTCHA V4

  14. KeyCaptcha

  15. Lemin

  16. Siara

  17. Turnstile

Find more info on example and images folders.

Register to DeathByCaptcha first to get access.

A simple and lightweight library to use deathbycaptcha api.

Install

npm install @sanjarani/dbc

Usage:

Just call HttpClient or SocketClient class based on your prefer connection and call methods:

const dbc = require('@sanjarani/dbc');

const args = process.argv;

const username = "your-username";     // DBC account username
const password = "your-password";     // DBC account password
const clienttype = args[4];

let client;

if (clienttype === "HTTP"){
    console.log("Using http client");
    client = new dbc.HttpClient(username, password);
}
else {
    console.log("using sockets client")
    client = new dbc.SocketClient(username, password);
}

// Get user balance
client.get_balance((balance) => {
    console.log(balance);
});


Available methods:

There are two types of Death by Captcha (DBC hereinafter) API:

HTTP and Socket ones.

Both offer the same functionalily, with the socket API sporting faster responses and using way less connections.

To access the Socket API, use SocketClient class; for the HTTP API, use HttpClient class.


Both SocketClient and HttpClient give you the following methods:

get_user

 get_user((user) => {})

Returns your DBC account details as a JSON with the following keys :

{
    "user": {},
    // your account numeric ID; if login fails, it will be the only item with the value of 0;
            
    "rate": {},
    // your CAPTCHA rate, i.e. how much you will be charged for one solved CAPTCHA in US cents;
            
    "balance": {}, 
    // your DBC account balance in US cents;
        
    "is_banned": {} 
    // flag indicating whether your account is suspended or not.
}

get_balance

get_balance((balance) => {})

Returns your DBC account balance in US cents (null for invalid user).

// example : 
224.1401

get_captcha

get_captcha(cid, (captcha) => {})
//The only argument `cid` is the CAPTCHA numeric ID.

Returns an uploaded CAPTCHA details as a JSON with the following keys:

{
    "captcha": {},
     // the CAPTCHA numeric ID; if no such CAPTCHAs found, it will be the only item with the value of 0;
     
    "text": {},
     // the CAPTCHA text, if solved, otherwise None;
     
    "is_correct": {}
     // flag indicating whether the CAPTCHA was solved correctly (DBC can detect that in rare cases).
}



get_text

get_text(cid, (text) => {}) 
// The only argument `cid` is the CAPTCHA numeric ID.

Returns an uploaded CAPTCHA text (null if not solved).



report

report(cid, (success) => {})
// The only argument `cid` is the CAPTCHA numeric ID.

Reports an incorrectly solved CAPTCHA.

Returns true on success, false otherwise.


upload

upload({ captcha = null, extra = {} }, (captcha) => {}) 
// The only argument `captcha` is the CAPTCHA image file name.

Uploads a CAPTCHA.

On successul upload you'll get the CAPTCHA details JSON

see get_captcha() method.

NOTE: AT THIS POINT THE UPLOADED CAPTCHA IS NOT SOLVED YET!
You have to poll for its status periodically using get_captcha() or get_text() method until the CAPTCHA is solved and you get the text.


decode

decode({ captcha = null, timeout = null, extra = {} }, (captcha) => {})

A convenient method that uploads a CAPTCHA and polls for its status periodically, but no longer than timeout (defaults to 60 seconds).

If solved, you'll get the CAPTCHA details JSON (see get_captcha() method for details). See upload() method for details on captcha argument.

Simple and fast example using decode :

Select HttpClient or SocketClient first, and then call decode method using image path and timeout:

const dbc = require('@sanjarani/dbc');

const username = "your-username";     // DBC account username
const password = "your-password";     // DBC account password

let client;
let img = '../images/normal.jpg';

client = new dbc.SocketClient(username, password);

// decode a captcha
client.decode({
    captcha: img,
    timeout: 30
}, (response) => {
    console.log(response);
});

The response object will return this result :

{
  captcha: 1633458547, //"captcha id"
  text:  "captcha text",
  is_correct: true,
  status: 0
}

License

This module released under the MIT license.

Author

Kiyarash Sanjarani Vahed

<style> .h {width:14px; height: 14px; color: green} .g {color: green; font-size: 17px;} </style>