Help with POST for DeathbyCaptcha's new API

Ehnoah

Новичок
Регистрация
16.03.2015
Сообщения
29
Благодарностей
2
Баллы
3
Hey guys,

(Yes test is not my Login, I just take out)

so I used a adapted Script for the new reCaptcha of google found here:
http://zennolab.com/discussion/threads/kapcha.19555/page-2#post-133476

now I edited the request to following for deathbycaptcha:

URL : http://api.dbcapi.me/api/captcha

Код:
--method
Content-Disposition: form-data; name="method"

post
--username
Content-Disposition: form-data; name="username"

Test
--password
Content-Disposition: form-data; name="password"

Test
--CaptchaScreenshot(the 6 Images)
Content-Disposition: form-data; name="captchafile"; filename="{-Project.Directory-}{-Variable.re_captha-}.jpg"
Content-Type: image/jpg

{-Project.Directory-}{-Variable.re_captha-}.jpg
--The Image on Top (preview Image)
Content-Disposition: form-data; name="banner"; filename="{-Project.Directory-}{-Variable.re_captha2-}.jpg"
Content-Type: image/jpg

{-Project.Directory-}{-Variable.re_captha2-}.jpg
--The Text like (select xyz)
Content-Disposition: form-data; name="banner_text"

{-Variable.Base_text-}
--type of Captcha (3 for the new one)
Content-Disposition: form-data; name="type"

3
The Request response is empty. So I guess I made a mistake. The Image need to be coded in BASE64. Did I everything correct ?

API:
username
password
captchafile
banner
banner_text
type
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Do DBC support that kind of captchas?
cause rucaptcha support them as API paramenter
you cannot just send data to the same way if service doesnt offer that API feature
 

Ehnoah

Новичок
Регистрация
16.03.2015
Сообщения
29
Благодарностей
2
Баллы
3
Hey,

thanks for reply. yes the API is new.

Captchafile and banner are BASE64 Images I need to sent.

Is there some Kind of Debug to see the request when it is finished?

so I may can check on this End?
 
Последнее редактирование:

LexxWork

Client
Регистрация
31.10.2013
Сообщения
1 190
Благодарностей
791
Баллы
113
use fiddler and proxy of fiddler in http requests.
 

Ehnoah

Новичок
Регистрация
16.03.2015
Сообщения
29
Благодарностей
2
Баллы
3
Edit: My fault on 2. File not found! Do I make the Images to Base64 or do they are get automaticly BASE64?

It sent everything correct. So I guess it is a API error? because I get "Internal-Server-Error" guess it is a Deathby prob. now?
 

Вложения

Последнее редактирование:

Ehnoah

Новичок
Регистрация
16.03.2015
Сообщения
29
Благодарностей
2
Баллы
3
Tried now to Encode my Images to BASE64 but if I try the Script I found in Forum result = SORRY

Changed Variable to my image ("image") ("image" = local Saved Image from Project Path)

Код:
//Отправка капчи из картинки
var captcha__get = project.Variables["Image"].Value;
var image = System.Drawing.Image.FromFile(@captcha__get);
string base64String = String.Empty;
using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
{
  image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
  byte[] imageBytes = ms.ToArray();
  base64String = Convert.ToBase64String(imageBytes);
}
var result = ZennoPoster.CaptchaRecognition("Anti-Captcha.dll", base64String, "");
// отрезаем лишнее
var tmp = result.Split(new [] {"-|-"}, StringSplitOptions.None);
if (tmp.Length > 1) return tmp[0];
return result;
 

LexxWork

Client
Регистрация
31.10.2013
Сообщения
1 190
Благодарностей
791
Баллы
113
if you are getting capthca images of not png format there would be exception
just use var b64 = Convert.ToBase64String(File.ReadAllBytes("your path to img"));
 
Последнее редактирование:

Ehnoah

Новичок
Регистрация
16.03.2015
Сообщения
29
Благодарностей
2
Баллы
3
Sorry I am not that pro with C#

the Captcha Images are in JPG (since the CaptchaSaver.dll how I save them) make JPG so if I make them to PNG it would work? (The Script)

if not I have to add

var b64 = Converter.FromBase64String(File.ReadAllBytes("your path to img")); for JPG?
 

LexxWork

Client
Регистрация
31.10.2013
Сообщения
1 190
Благодарностей
791
Баллы
113
var b64 = Convert.ToBase64String(File.ReadAllBytes("your path to img"));
var result = ZennoPoster.CaptchaRecognition("Anti-Captcha.dll", b64, "").Split(new [] {"-|-"}, StringSplitOptions.None);
if (result.Length > 1) return result[0];
return result;

jpeg is much more better if server support that

also if you are using the browser you don't need to save captchas to file, just search the html element and do DrawToBitmap => you get base64 string ready to send to service.
 
Последнее редактирование:

Ehnoah

Новичок
Регистрация
16.03.2015
Сообщения
29
Благодарностей
2
Баллы
3
Is this for PNG or JPG?

And for Variable from Profile is it like this?

Код:
var captcha__get = project.Variables["Image"].Value;
var image = System.Drawing.Image.FromFile(@captcha__get);
var b64 = Convert.ToBase64String(File.ReadAllBytes(image));
var result = ZennoPoster.CaptchaRecognition("Anti-Captcha.dll", b64, "").Split(new [] {"-|-"}, StringSplitOptions.None);
if (result.Length > 1) return result[0];

return result;

Edit: Currently it save the Captcha images with CaptchaSaver.dll and sent the Images to Server ( was for 2Captcha ) but DeathbyCaptcha require BASE64 images so I am not realy sure if I can reprogram it so that is why I search for convert.

If CaptchaSaver.dll also can BASE64 would be nice
 

LexxWork

Client
Регистрация
31.10.2013
Сообщения
1 190
Благодарностей
791
Баллы
113
for any stream format
 

Ehnoah

Новичок
Регистрация
16.03.2015
Сообщения
29
Благодарностей
2
Баллы
3
Thanks to Lexx for help me on TeamViewer :-)
 
  • Спасибо
Реакции: rostonix

irmscher

Client
Регистрация
28.11.2012
Сообщения
199
Благодарностей
6
Баллы
18
So is it possible to send an API reques to to death by captcha using Zennoposter's POST only?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)