API

لأغراض الأتمتة ، يوفر Death By Captcha (DBC) واجهات برمجة تطبيقات للمستخدمين والمطورين للتكامل مع أي برنامج معين.

تسير عملية الحل على النحو التالي:

تحقق من تفاصيل API أدناه للحصول على معلومات وموارد إضافية لتنفيذ DBC باستخدام الأداة (الأدوات) المفضلة و / أو لغة البرمجة!

إصدار: 4.6

عملاء الطرف الثالث

require_once 'deathbycaptcha.php';
// Put your DBC credentials here.
// Use DeathByCaptcha_HttpClient class if you want to use HTTP API.
$client = new DeathByCaptcha_SocketClient(USERNAME, PASSWORD);

// Put the CAPTCHA file name or handler, and desired timeout (in seconds) here:
if ($captcha = $client->decode(CAPTCHA_FILE_NAME, TIMEOUT)) {
    echo $captcha['text'] . "\n";
    // Report the CAPTCHA if solved incorrectly.
    // Make sure the CAPTCHA was in fact incorrectly solved!
    if ( ... ) {
        $client->report($captcha['captcha']);
    }
}
// Repeat for other CAPTCHAs
require_once 'deathbycaptcha.php';
// Put your DBC credentials here.
// Use DeathByCaptcha_HttpClient class if you want to use HTTP API.
// To use token username must be authtoken.
$client = new DeathByCaptcha_SocketClient("authtoken", token-from-panel);

// Put the CAPTCHA file name or handler, and desired timeout (in seconds) here:
if ($captcha = $client->decode(CAPTCHA_FILE_NAME, TIMEOUT)) {
    echo $captcha['text'] . "\n";

    // Report the CAPTCHA if solved incorrectly.
    // Make sure the CAPTCHA was in fact incorrectly solved!
    if ( ... ) {
        $client->report($captcha['captcha']);
    }
}
// Repeat for other CAPTCHAs
// Do not forget to reference DeathByCaptcha.dll in your project!
using DeathByCaptcha;

// Put your DBC credentials here.
// Use HttpClient class if you want to use HTTP API.
Client client = (Client) new SocketClient(USERNAME, PASSWORD);

// Put your CAPTCHA file name, stream, or vector of bytes,
// and desired timeout (in seconds) here:
Captcha captcha = client.Decode(CAPTCHA_FILE_NAME, TIMEOUT);
if (captcha.Solved && captcha.Correct) {
    Console.WriteLine("CAPTCHA {0}: {1}", captcha.Id, captcha.Text);

    // Report the CAPTCHA if solved incorrectly.
    // Make sure the CAPTCHA was in fact incorrectly solved!
    if ( ... ) {
        client.Report(captcha);
    }
}

// Repeat for other CAPTCHAs
// Do not forget to reference DeathByCaptcha.dll in your project!
using DeathByCaptcha;

// Put your DBC credentials here.
// Use HttpClient class if you want to use HTTP API.
// Using token authentication in C#/VB, username must be authtoken.

Client client = (Client) new SocketClient("authtoken", token-from-panel);

// Put your CAPTCHA file name, stream, or vector of bytes,
// and desired timeout (in seconds) here:
Captcha captcha = client.Decode(CAPTCHA_FILE_NAME, TIMEOUT);
if (captcha.Solved && captcha.Correct) {
    Console.WriteLine("CAPTCHA {0}: {1}", captcha.Id, captcha.Text);

    // Report the CAPTCHA if solved incorrectly.
    // Make sure the CAPTCHA was in fact incorrectly solved!
    if ( ... ) {
        client.Report(captcha);
    }
}

// Repeat for other CAPTCHAs
We are using command line dotnet 6+
Make sure you already downloaded selenium browser driver
and double check the driver executable is on PATH
You can use ChromeDriver for Chrome or Geckodriver for Firefox
and can switch between these drivers on the C# source code.

Download C# Selenium project from the list above

Edit Program.cs and put your credentials there
string _username = "DBC_USERNAME";
string _password = "DBC_PASSWORD";

In the folder where .csproj file is located
Do the following comands to run the example:

dotnet restore to install the requirements
dotnet build to build the project
dotnet run to run the project

dotnet clean to clean the project


// Repeat for other CAPTCHAs
We are using Maven 3.6+
Make sure you already downloaded selenium browser driver
and double check the driver executable is on PATH
You can use ChromeDriver for Chrome or Geckodriver for Firefox
and can switch between these drivers on the Java source code.

Download Java Selenium project from the list above

Edit App.java and put your credentials there
Client client = new HttpClient("DBC_USERNAME", "DBC_PASSWORD");

In the folder where pom.xml file is located
Do the following comands to run the example:

mvn clean install -U to clean project and install dependencies
mvn exec:java -Dexec.mainClass="deathbycaptcha.App" to build the project

mvn clean to clean the project

Refer to Java and Maven project examples to more detail
We are using NodeJS v12+
Make sure you already downloaded selenium browser driver
and double check the driver executable is on PATH
You can use ChromeDriver for Chrome or Geckodriver for Firefox
and can switch between these drivers on the NodeJS source code.

Download NodeJS Selenium project from the list above

Edit nodeSeleniumExample.js and put your credentials there

const USERNAME = 'DBC_USERNAME'   // Your DBC username here
const PASSWORD = 'DBC_PASSWORD'   // Your DBC password here

In the folder where package.json file is located
Do the following comands to run the example:

npm install // to install dependencies
node recaptcha_example/nodeSeleniumExample.js // to run the example

Refer to NodeJS project examples to more detail
We are using Python v3+
Make sure you already downloaded selenium browser driver
and double check the driver executable is on PATH
You can use ChromeDriver for Chrome or Geckodriver for Firefox
and can switch between these drivers on the Python3 source code.

Download Python3 Selenium project from the list above

Edit python_selenium_example.py and put your credentials there

USERNAME = 'DBC_USERNAME'   # Your DBC username here
PASSWORD = 'DBC_PASSWORD'   # Your DBC password here

In the folder where requirements.txt file is located
Do the following comands to run the example:

python3 -m venv venv to create a new python3 venv
. venv/bin/activate to activate the venv
pip3 install -r requirements.txt to install dependencies
python3 python_selenium_example.py

Refer to Python3 project examples to more detail
Create new Python3 virtual environment

python3 -m venv venv

Activate the virtual environment
. venv/bin/activate

Install DeathByCaptcha library from pypi

pip install deathbycaptcha-official

Create our python3 script

import  deathbycaptcha
# don't forget to import deathbycaptcha library
username = 'username'
password = 'password'
authtoken =  ''
...

use the DeathByCaptcha python http client
http_client = deathbycaptcha.HttpClient(username, password, authtoken)
or use the DeathByCaptcha python sockets client
socket_client = deathbycaptcha.SocketClient(username, password, authtoken)

Refer to Python3 project examples to more detail.
Create new Maven project

mvn archetype:generate
-DgroupId=examples
-DartifactId=deathbycaptcha-examples
-DarchetypeArtifactId=maven-archetype-quickstart
-DarchetypeVersion=1.4
-DinteractiveMode=false

Include the following dependencies on maven pom.xml file

<dependencies>
<dependency>
<groupId>io.github.deathbycaptcha</groupId>
<artifactId>deathbycaptcha-java-library</artifactId>
<version>0.43</version>
</dependency>
</dependencies>

if the pom.xml is correct.
We can use the imports on our java files.

import com.DeathByCaptcha.AccessDeniedException;
import com.DeathByCaptcha.Client;
import com.DeathByCaptcha.HttpClient;
import com.DeathByCaptcha.SocketClient;
import com.DeathByCaptcha.Captcha;
...

Clean and build the project
mvn clean install -U
Run the project
mvn exec:java -Dexec.mainClass="examples.GetBalance" -Dexec.args=""
mvn exec:java -Dexec.mainClass="examples.ExampleFuncaptcha"
mvn exec:java -Dexec.mainClass="examples.ExampleHcaptcha"
mvn exec:java -Dexec.mainClass="examples.ExampleRecaptchaV2"
...

Refer to Java and Maven project examples to more detail

عند استخدام عملاء API Socket ، تأكد من عدم وجود اتصالات TCP الصادرة إلى المنافذ 8123-8130 جدار الحماية. استخدم عملاء HTTP API إذا كان عملاء API Socket لا يعملون من أجلك. نطاق المنافذ 8123-8130 مخصصة لمقبس التوصيل فقط ، لا تحاول استخدامه مع HTTP API!

لاحظ أن مكالمة إلى وظيفة/طريقة Decode يمكن أن تُرجع قيمة فارغة إذا تم الوصول إلى المهلة قبل حل Captcha. إذا حدث هذا في كثير من الأحيان ، وزيادة المهلة المستخدمة.

لمزيد من التفاصيل ، انظر الأمثلة المضمنة في كل حزمة عميل API وتحقق من رمز مصدر العملاء.

  1. للتحقق من رصيدك ، قم بتشغيل:
    deathbycaptcha.exe -l USERNAME -p PASSWORD -b
    أو باستخدام رمز المصادقة
    deathbycaptcha.exe -a AUTHTOKEN -b
    سيتم حفظ رصيدك في ملف Balance.txt وطباعته على الإخراج القياسي.
  2. لتحميل captcha ، قم بتشغيل:
    deathbycaptcha.exe -l USERNAME -p PASSWORD -c CAPTCHA_FILE_NAME [-t TIMEOUT]
    أو باستخدام رمز المصادقة
    deathbycaptcha.exe -a AUTHTOKEN -c CAPTCHA_FILE_NAME [-t TIMEOUT]
    المهلة الافتراضية Captcha Solving هي 60 ثانية.
    إذا تم حلها ، فسيتم حفظ معرف Captcha في id.txt ، سيتم حفظ نص Captcha في Assew.txt ، وسيتم طباعة كل من المعرف والنص على الإخراج القياسي مفصولة بمساحة.
  3. للإبلاغ عن captcha تم حلها بشكل غير صحيح ، قم بتشغيل:
    deathbycaptcha.exe -l USERNAME -p PASSWORD -n CAPTCHA_ID
    أو باستخدام رمز المصادقة
    deathbycaptcha.exe -a AUTHTOKEN -n CAPTCHA_ID

قبل تنفيذ خاصتك Death By Captcha HTTP API Client ، يرجى النظر بجدية في استخدام API Socket مع أحد عملائنا الرسميين المدرجين أعلاه.

عنوان URL API هو http://api.dbcapi.me/api/. مسار url يتغير اعتمادًا على الإجراء المطلوب. جميع الردود من الطلبات المقدمة إلى واجهة برمجة التطبيقات لها حقلين مشتركان:

  • status — حالة الطلب. 0 إذا لم تكن هناك أخطاء أثناء معالجة الطلب الداخلي ، 255 خلاف ذلك.
  • error — شرح قصير للخطأ الذي حدث. عاد فقط عندما تكون الحالة 255.

للحصول على تفاصيل حول مسار عنوان URL الصحيح والحقول التي تم إرجاعها الأخرى لاتخاذ إجراء محدد ، راجع القسم أدناه.

All API responses are returned URL-encoded by default. If JSON encoding is desired, include application/json in the Accept header of your request. Note that boolean true will be returned as 1 in URL-encoded responses and as true in JSON-encoded responses. Boolean false will be returned as 0 in URL-encoded responses and as false in JSON-encoded responses.

ما هي تحديات "captcha العادية"؟

يعتمد هذا النوع من اختبار CAPTCHA على الصور ويتطلب إدخال سلسلة من الأحرف أو الأرقام من صورة مشوهة.

لتحميل captcha ، أصدر طلب POST multipart/form-data إلى http://api.dbcapi.me/api/captcha. يجب أن يحتوي الطلب على الحقول التالية:

  • username — الخاص بك Death By Captcha اسم المستخدم.
  • password — كلمة مرور Death By Captcha.
  • captchafile — صورة Captcha.

في حال كنت تستخدم المصادقة الرمزية:

  • authtoken — الخاص بك Death By Captcha رمز المصادقة.
  • captchafile — صورة Captcha.

captchafile يجب أن يكون إما ملف صورة captcha الخام، أو صورة captcha مشفرة في base64 مسبقة بـ base64: البادئة. يقتصر حجم ملف الصورة على أقل من 180 كيلو بايت. عندما يتم ترميز الصورة في Base64، يجب أن يكون الحجم أقل من 120 كيلو بايت. التنسيقات المدعومة للصور هي JPG، PNG، GIF و BMP.

هنا هو نموذج HTML الذي يقوم بالخدعة:

<form action="http://api.dbcapi.me/api/captcha"method="post" enctype="multipart/form-data">
    <input type="text"     name="username" value="">
    <input type="password" name="password" value="">
    <input type="file"     name="captchafile">
</form>

أو استخدام المصادقة الرمزية:

<form action="http://api.dbcapi.me/api/captcha"method="post" enctype="multipart/form-data">
    <input type="text"     name="authtoken" value="">
    <input type="file"     name="captchafile">
</form>

فيما يلي ما يعادل الأمر:

curl --header 'Expect: ' -F username=YOUR_USERNAME  -F password=YOUR_PASSWORD  -F captchafile=@YOUR_CAPTCHA_FILENAME http://api.dbcapi.me/api/captcha

أو استخدام المصادقة الرمزية:

curl --header 'Expect: ' -F authtoken=YOUR_AUTHTOKEN  -F captchafile=@YOUR_CAPTCHA_FILENAME http://api.dbcapi.me/api/captcha

base64-encoded يجب أن يبدو حقل captchafile هكذا:

base64:R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAICTAEAOw==

ستحصل على واحدة من ردود HTTP التالية:

  • 303 See Other إذا تم تحميل Captcha بنجاح ، الموقع سوف يوجهك رأس http إلى صفحة حالة captcha المحمّلة ، فيمكنك اتباع الموقع إلى الحصول على حالة captcha المحمّلة. أيضا ، سيتم إرجاع الحقول التالية:
    • captcha — معرف Captcha تم تحميله.
    • is_correct — 1 إذا تم تحديد إجابة لهذا Captcha أو لا يزال يتم معالجتها ، 0 إذا انتهت المعالجة ولا يمكن العثور على إجابة.
    • text — إجابة Captcha. سلسلة فارغة تعني أن Captcha لم يتم حلها بعد.
    مثال مشفر URL:
    status=0&captcha=123&is_correct=1&text=
    مثال JSON المشفر:
    { "status": 0, "captcha": 123, "is_correct": 1, "text": "" }
  • 403 Forbidden إذا تم رفض بيانات الاعتماد الخاصة بـ Death By Captcha، أو إذا لم يكن لديك ما يكفي من الرصيد.
  • 400 Bad Request إذا لم يتبع طلبك المواصفات أعلاه ، أو تم رفض Captcha لعدم كونه صورة صالحة.
  • 500 Internal Server Error إذا حدث شيء ما إلى جانبنا يمنعك من تحميل Captcha ؛ إذا كنت متأكدًا من أنك ترسل طلبات منظمة بشكل صحيح مع صور Captcha صالحة ولكن المشكلة تستمر ، فيرجى الاتصال بدعمنا المباشر وإخبارهم بتفاصيل كيفية إعادة إنتاج المشكلة.
  • 503 Service Temporarily Unavailable عندما تكون خدمتنا مثقلة ، حاول مرة أخرى لاحقًا.

في هذه المرحلة ، قد لا يتم حل captcha الذي قمت بتحميله للتو حتى الآن! إذا لم تتلق الإجابة في مفتاح text من استجابة الخادم ، فيجب عليك الاستفسار. الرجوع إلى استطلاع حالة CAPTCHA المحملة لمزيد من التفاصيل.

للحصول على حالة captcha التي تم تحميلها ، قم بإصدار طلب للحصول على http://api.dbcapi.me/api/captcha/%CAPTCHA_ID%, حيث %CAPTCHA_ID% هو معرف captcha الخاص بك المحمّل الذي يتم الحصول عليه أثناء تحميل captcha. لا تضطر إلى توفير بيانات الاعتماد Death By Captcha هذه المرة. سيكون الرد استجابة HTTP 200 OK مع نفس الحقول الموضحة في الاستجابة 303 انظر الآخرين من قسم تحميل CAPTCHA.

إذا لم يتم حل CAPTCHA بعد، فسيأتي المفتاح text فارغًا. يتعين عليك الاستمرار في الاستعلام عن هذه الإجابة. أمثلة للاستجابات:

  • استجابة مشفرة عن URL من captcha حلت بشكل صحيح
    status=0&captcha=1234&is_correct=1&text=tyrone+slothrop
  • استجابة JSON المشفرة من captcha حلشها بشكل صحيح
    { "captcha": 1234, "is_correct": true,"status": 0, "text": "tyrone slothrop" }
  • استجابة json المشفرة من captcha حلت بشكل غير صحيح
    { "captcha": 1234, "is_correct": false, "status": 0, "text": "?" }
  • استجابة JSON المشفرة لكسر
    { "captcha": 0, "status": 0 }
    إذا حصلت على هذا الرد ، فأكّن أن معرف Captcha الذي تستخدمه للاستطلاع للإجابة هو نفسه الذي تم إرجاعه عند تحميله. إذا استمرت المشكلة ، فلا تتردد في اتصل بنا .

يرجى لا استطلاع للحصول على حالة Captcha أكثر من مرة في بضع ثوان .
يعتبر هذا سلوكاً مسيئاً وقد يؤدي إلى حظرك.
يرجى الحفاظ على عرض النطاق الترددي الخاص بك وعرض النطاق الترددي الخاص بنا.

إذا كنت تعتقد أن Captcha الخاص بك قد تم حلها بشكل غير صحيح ، فأبلغها بـ Death By Captcha لاسترداد أموالك. للقيام بذلك ، قم بإصدار طلب منشور إلى http://api.dbcapi.me/api/captcha/%CAPTCHA_ID%/report مع الحقول التالية:

  • username — الخاص بك Death By Captcha اسم المستخدم.
  • password — كلمة مرور Death By Captcha.

أو باستخدام رمز المصادقة:

  • authtoken — الخاص بك Death By Captcha رمز المصادقة.

سيكون الرد:

  • 200 OK إذا تم الانتهاء من التقرير. في هذه الحالة ، سيتم رد الاعتمادات الخاصة بك. سيكون هيئة الاستجابة هي نفسها بالنسبة لاستطلاع الاستطلاع (أو التحميل) ولكن حقل is_correct سيكون 0. مثال:
    { "captcha": 1234, "is_correct": false,"status": 0, "text": "tyrone slothrop" }
  • 503 Service Unavailable إذا لم يكن من الممكن إكمال التقرير. قد يكون هذا بسبب:
    1) لم يتم تحميل Captcha المقابلة لمعرف المقدم بواسطة المستخدم الذي يبلغ عنه ؛
    2) تم حظر المستخدم الخاص بك ؛
    3) تم إصداره أكثر من ساعة بعد أن تم تحميلها. في هذه الحالة ، لن يتم ردك.

سيؤدي الإساءة إلى هذه الميزة إلى حظر!

للتحقق من رصيد الائتمان الخاص بك ، قم بإصدار طلب الحصول على أو نشر إلى http://api.dbcapi.me/api مع الحقول التالية:

  • username — الخاص بك Death By Captcha اسم المستخدم.
  • password — كلمة مرور Death By Captcha.

أو باستخدام رمز المصادقة:

  • authtoken — الخاص بك Death By Captcha رمز المصادقة.

في المصادقة الناجحة ، ستحصل على 200 OK استجابة مع Death By Captcha تفاصيل الحساب ، إما عناوين URL- أو JSON ، مع الحقول التالية:

  • user — الخاص بك Death By Captcha معرف الحساب ؛
  • rate — إلى أي مدى نتقاضى لك مقابل حلها بشكل صحيح captcha ، في US¢ ؛
  • balance — رصيدك الائتماني الحالي ، في US¢.
  • is_banned — 1 إذا تم حظر المستخدم ، 0 إذا لم يكن كذلك.

مثال على الاستجابة المصنوعة من JSON:

{ "is_banned": false, "status": 0, "rate": 0.139,"balance": 455.23, "user": 43122 }

من أجل تلقي حالة الخادم الحالية ، قم بإصدار طلب الحصول على http://api.dbcapi.me/api/status. سيكون للرد الحقول التالية:

  • todays_accuracy — العدد الذي يمثل الدقة في النسبة المئوية (على سبيل المثال ، 99.6 يمثل 99.6 ٪)
  • solved_in — متوسط ​​وقت حل في الثواني
  • is_service_overloaded — 1 إذا كانت الخدمة مثقلة ، 0 خلاف ذلك

مثال على الاستجابة المصنوعة من JSON:

{ "status": 0, "todays_accuracy": 99.9, "solved_in": 5.3,"is_service_overloaded": false }

حالة: OK

تعمل الخوادم بشكل كامل مع وقت استجابة أسرع من المتوسط.
  • متوسط وقت الحل
  • 2 ثواني - Normal CAPTCHAs (1 دقيقة. منذ)
  • 30 ثواني - reCAPTCHA V2, V3, etc (1 دقيقة. منذ)
  • 25 ثواني - hCAPTCHA & آحرون (1 دقيقة. منذ)
Chrome and Firefox logos
امتدادات المتصفح المتاحة

التحديثات

  1. Feb 26: NEW TYPE ADDED - Now supporting Friendly CAPTCHA!! See the details at https://deathbycaptcha.com/api/friendly
  2. Nov 22: Now supporting Amazon WAF!! See the details at https://deathbycaptcha.com/api/amazonwaf
  3. Nov 01: Today our Socket API was affected by a technical issue for a few hours. It's now sorted and back to 100%, working optimally. We sincerely apologize for the inconvenience this may have caused you. If you were affected, please don't hesitate to contact us: https://deathbycaptcha.com/contact and we'll be happy to assist/compensate you!

  4. التحديثات السابقة…

الدعم

تم تصميم نظامنا ليكون سهل الاستخدام تمامًا وسهل الاستخدام. إذا كان لديك أي مشكلة في ذلك ، ما عليك سوى مراسلتنا عبر البريد الإلكتروني على البريد الإلكتروني للدعم الفني لـ DBC com ، وسيتواصل معك أحد وكلاء الدعم في أقرب وقت ممكن.

الدعم المباشر

متاح من الاثنين إلى الجمعة (من 10 صباحًا حتى 4 مساءً بتوقيت شرق الولايات المتحدة) Live support image. Link to live support page