Death by Captcha HTTP and Socket API clients.
-
✔ 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.
npm install @sanjarani/dbc
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);
});
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.
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((balance) => {})
Returns your DBC account balance in US cents (null for invalid user).
// example :
224.1401
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(cid, (text) => {})
// The only argument `cid` is the CAPTCHA numeric ID.
Returns an uploaded CAPTCHA text (null if not solved).
report(cid, (success) => {})
// The only argument `cid` is the CAPTCHA numeric ID.
Reports an incorrectly solved CAPTCHA.
Returns true on success, false otherwise.
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({ 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.
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.
This module released under the MIT license.
<style> .h {width:14px; height: 14px; color: green} .g {color: green; font-size: 17px;} </style>