ANTICHAT — форум по информационной безопасности, OSINT и технологиям
ANTICHAT — русскоязычное сообщество по безопасности, OSINT и программированию.
Форум ранее работал на доменах antichat.ru, antichat.com и antichat.club,
и теперь снова доступен на новом адресе —
forum.antichat.xyz.
Форум восстановлен и продолжает развитие: доступны архивные темы, добавляются новые обсуждения и материалы.
⚠️ Старые аккаунты восстановить невозможно — необходимо зарегистрироваться заново.

16.10.2009, 09:57
|
|
Banned
Регистрация: 25.11.2007
Сообщений: 62
Провел на форуме: 1702086
Репутация:
89
|
|
bmp12, вот еще, кстати, попробуйте функцию (переписывал под себя, чтобы капчу на диск не сохранять)
Код:
function recognize (itype: string; key: string; image : tmemorystream) : string;
var
ftype, s, id: string;
i: integer;
http: tidhttp;
multi: tidmultipartformdatastream;
begin
if strpos (pchar (itype), 'jpg') <> nil then ftype := 'image/pjpeg';
if strpos (pchar (itype), 'gif') <> nil then ftype := 'image/gif';
if strpos (pchar (itype), 'png') <> nil then ftype := 'image/png';
multi := Tidmultipartformdatastream.Create;
multi.AddFormField ('method', 'post');
multi.AddFormField ('key', key);
multi.AddObject ('file', ftype, image, 'captcha.' + itype);
http := tidhttp.Create;
s := http.Post ('http://antigate.com/in.php', multi);
http.Free; multi.Free;
id := '';
if strpos (Pchar (s), 'ERROR_') <> nil then begin result := s; exit; end;
if strpos (Pchar (s), 'OK|') <> nil then id := AnsiReplaceStr (s, 'OK|', '');
if id = '' then result := 'ERROR: bad captcha id';
for i := 1 to 20 do
begin
sleep (5000);
http := tidhttp.Create;
s := http.Get ('http://antigate.com/res.php?key=' + key + '&action=get&id=' + id);
http.Free;
if strpos (Pchar (s), 'ERROR_') <> nil then begin result := s; exit; end;
if strpos (Pchar (s), 'OK|') <> nil then
begin
result := AnsiReplaceStr (s, 'OK|', '');
exit;
end;
end;
result := 'ERROR_TIMEOUT';
end;
Обращение: recognize ('jpg', ackey, image) - тип картинки / ас ключ / картинка в tmemorystream
|
|
|
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|