@sanjarani/dbc
v1.0.15
Published
A package to use DeathByCaptcha API Client Fast and Easy.
Downloads
3
Maintainers
Readme
Death by Captcha HTTP and Socket API clients.
Solve and bypass All kind of captcha :
✔ Normal image captcha
✔ Text Captcha
✔ reCAPTCHA Coordinates
✔ reCAPTCHA Image Group
✔ reCAPTCHA V2
✔ reCAPTCHA V3
✔ Amazon WAF
✔ HCAPTCHA
✔ Audio Captcha
✔ Capy Captcha
✔ Fun Captcha
✔ Geetest CAPTCHA V3
✔ Geetest CAPTCHA V4
✔ KeyCaptcha
✔ Lemin
✔ Siara
✔ 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
}
Visit http://www.deathbycaptcha.com/user/api for updates.
License
This module released under the MIT license.