minicl55

Untitled

Aug 28th, 2014
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.66 KB | None | 0 0
  1. Death By Captcha now supports DeCaptcher API (both socket and HTTP), and Antigate (Anti-Captcha) API!
  2. Death By Captcha API
  3. Latest version: 4.2
  4. .NET (C#, Visual Basic)
  5. AutoIt3
  6. iMacros
  7. C (client and libs' source code)
  8. Java
  9. Perl 5+
  10. PHP v5+
  11. Python v2.5+ and v3.0+
  12. Command-line tool for Windows, Linux (i386 and x86-64) (see usage note below)
  13. Plugin for MyAdTools bots
  14. Third-party clients
  15. No support from us, use at your own risk.
  16.  
  17. Ruby
  18.  
  19. How to use our API clients
  20. Download the latest client, add it to your application and write something along the lines below, f.i in PHP:
  21.  
  22. require_once 'deathbycaptcha.php';
  23.  
  24. // Put your DBC credentials here.
  25. // Use DeathByCaptcha_HttpClient class if you want to use HTTP API.
  26. $client = new DeathByCaptcha_SocketClient(USERNAME, PASSWORD);
  27.  
  28. // Put the CAPTCHA file name or handler, and desired timeout (in seconds) here:
  29. if ($captcha = $client->decode(CAPTCHA_FILE_NAME, TIMEOUT)) {
  30. echo $captcha['text'] . "\n";
  31.  
  32. // Report the CAPTCHA if solved incorrectly.
  33. // Make sure the CAPTCHA was in fact incorrectly solved!
  34. if ( ... ) {
  35. $client->report($captcha['captcha']);
  36. }
  37. }
  38.  
  39. // Repeat for other CAPTCHAs
  40. …or in C#:
  41.  
  42. // Do not forget to reference DeathByCaptcha.dll in your project!
  43. using DeathByCaptcha;
  44.  
  45. // Put your DBC credentials here.
  46. // Use HttpClient class if you want to use HTTP API.
  47. Client client = (Client) new SocketClient(USERNAME, PASSWORD);
  48.  
  49. // Put your CAPTCHA file name, stream, or vector of bytes,
  50. // and desired timeout (in seconds) here:
  51. Captcha captcha = client.Decode(CAPTCHA_FILE_NAME, TIMEOUT);
  52. if (captcha.Solved && captcha.Correct) {
  53. Console.WriteLine("CAPTCHA {0}: {1}", captcha.Id, captcha.Text);
  54.  
  55. // Report the CAPTCHA if solved incorrectly.
  56. // Make sure the CAPTCHA was in fact incorrectly solved!
  57. if ( ... ) {
  58. client.Report(captcha);
  59. }
  60. }
  61.  
  62. // Repeat for other CAPTCHAs
  63. When using socket API clients, make sure you don't have outgoing TCP connections to ports 8123–8130 firewalled. Use HTTP API clients if socket API clients do not work for you. The 8123–8130 ports range is for socket API only, do not try to use it with HTTP API!
  64.  
  65. For more details see examples included in each API client package and check the clients' source code.
  66.  
  67. How to use our command-line tool
  68. To check your balance, run:
  69. dbcclient.exe -l USERNAME -p PASSWORD -b
  70. Your balance will be saved in balance.txt file and printed out on the standard output.
  71. To upload a CAPTCHA, run:
  72. dbcclient.exe -l USERNAME -p PASSWORD -c CAPTCHA_FILE_NAME [-t TIMEOUT]
  73. Default CAPTCHA solving timeout is 60 seconds.
  74. If solved, the CAPTCHA ID will be saved in id.txt, the CAPTCHA text will be saved in answer.txt, and both ID and text will be printed out on the standard output separated by a space.
  75. To report an incorrectly solved CAPTCHA, run:
  76. dbcclient.exe -l USERNAME -p PASSWORD -n CAPTCHA_ID
  77. HTTP API technical details
  78. Before implementing your own Death By Captcha HTTP API client, please seriously consider using socket API with one of our official clients listed above.
  79.  
  80. Solving a CAPTCHA using Death By Captcha HTTP API requires performing at least the first two of the steps described below.
  81.  
  82. 1. Uploading a CAPTCHA
  83. To upload a CAPTCHA, issue a multipart/form-data POST request to http://api.dbcapi.me/api/captcha. The request must contain the following fields:
  84.  
  85. username — your Death By Captcha username;
  86. password — your Death By Captcha password;
  87. captchafile — the CAPTCHA image.
  88. captchafile should be either raw CAPTCHA image file, or base64-encoded CAPTCHA image prepended with base64: prefix.
  89.  
  90. Here is the HTML form that does the trick:
  91.  
  92. <form action="http://api.dbcapi.me/api/captcha"
  93. method="post"
  94. enctype="multipart/form-data">
  95. <input type="text" name="username" value="">
  96. <input type="password" name="password" value="">
  97. <input type="file" name="captchafile">
  98. </form>
  99. Here is cURL command equivalent:
  100.  
  101. curl --header 'Expect: ' -F username=YOUR_USERNAME \
  102. -F password=YOUR_PASSWORD \
  103. -F captchafile=@YOUR_CAPTCHA_FILENAME \
  104. http://api.dbcapi.me/api/captcha
  105. base64-encoded captchafile field should look like this:
  106.  
  107. base64:R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAICTAEAOw==
  108. You'll get one of the following HTTP responses:
  109.  
  110. 303 See Other if your CAPTCHA was successfully uploaded: Location HTTP header will point you to the uploaded CAPTCHA status page, you may follow the Location to get the uploaded CAPTCHA status or parse the CAPTCHA unique ID out of Location URL — the scheme is http://api.dbcapi.me/api/captcha/%CAPTCHA_ID%;
  111. 403 Forbidden if your Death By Captcha credentials were rejected, or you don't have enough credits;
  112. 400 Bad Request if your request was not following the specification above, or the CAPTCHA was rejected for not being a valid image image;
  113. 500 Internal Server Error if something happened on our side preventing you from uploading the CAPTCHA; if you are sure you're sending properly prepared requests, and your CAPTCHA images are valid, yet the problem persists, please contact our live support and tell them in details how to reproduce the issue;
  114. 503 Service Temporarily Unavailable when our service is overloaded (usually around 3:00–6:00 PM EST), try again later.
  115. At this point the CAPTCHA you've just uploaded is not solved yet! Proceed to the 2nd step.
  116.  
  117. 2. Polling for uploaded CAPTCHA status
  118. To get an uploaded CAPTCHA status, issue a GET request to http://api.dbcapi.me/api/captcha/%CAPTCHA_ID%, where %CAPTCHA_ID% is your uploaded CAPTCHA ID acquired during the 1st step. You don't have to supply your Death By Captcha credentials this time.
  119.  
  120. You'll get one of the following HTTP responses:
  121.  
  122. 200 OK with your uploaded CAPTCHA details (see below);
  123. 404 Not Found if no CAPTCHAs with %CAPTCHA_ID% ID were found.
  124. CAPTCHA details are made of the following fields:
  125.  
  126. captcha — CAPTCHA unique ID;
  127. text — CAPTCHA text (empty string if not solved yet);
  128. is_correct — flag whether the CAPTCHA was correctly solved.
  129. By default you'll get the CAPTCHA details URL-encoded, like this:
  130.  
  131. captcha=1234&is_correct=1&text=tyrone+slothrop
  132. However it is also possible to receive JSON-encoded details, like this:
  133.  
  134. {"captcha": 1234, "is_correct": true, "text": "tyrone slothrop"}
  135. To do so, add application/json to your request's Accept HTTP header.
  136.  
  137. Please don't poll for a CAPTCHA status more than once in a couple of seconds.
  138. This is considered abusive and might get you banned.
  139. Conserve your and our bandwidth.
  140.  
  141. 3. Reporting incorrectly solved CAPTCHAs
  142. If you think your CAPTCHA was solved incorrectly, report it to Death By Captcha to get your money back. To do so, issue a POST request to http://api.dbcapi.me/api/captcha/%CAPTCHA_ID%/report with the following fields:
  143.  
  144. username — your Death By Captcha username;
  145. password — your Death By Captcha password.
  146. You'll get refunded if the CAPTCHA was uploaded less than an hour ago.
  147.  
  148. Abusing this feature will get you banned!
  149.  
  150. 4. Checking your credit balance
  151. To check your credit balance, issue a GET or POST request to http://api.dbcapi.me/api/user with the following fields:
  152.  
  153. username — your Death By Captcha username;
  154. password — your Death By Captcha password.
  155. On successful authentication, you'll get 200 OK response with your Death By Captcha account details, either URL- or JSON-encoded, with the following fields:
  156.  
  157. user — your Death By Captcha account ID, pretty useless;
  158. rate — how much we charge you for one solved CAPTCHA, in US¢;
  159. balance — your current credit balance, is US¢.
  160. Server status
  161. In order to receive current server status, issue a GET request to http://api.dbcapi.me/api/status
Advertisement
Add Comment
Please, Sign In to add comment