:SocketClient;
use strict;
use warnings;
our $VERSION = '0.01';
use IO::Socket;
use JSON qw(encode_json decode_json);
use MIME::Base64 qw(encode_base64);
use DeathByCaptcha::Exception;
use base 'Dea
DeathByCaptcha::Client::API_VERSION,
"cmd" => $cmd};
my $request = encode_json($cmdargs);
#printf("%d SEND: %d %s\n", time, length($request), $request);
$request .= +AP
\n", time, length($buff), $buff);
my $response;
eval { $response = decode_json($buff); };
if (defined $response) {
if (defined $response->{"error"})
JSON qw(decode_json);
use DeathByCaptcha::Exception;
use base 'DeathByCaptcha::Client';
use constant API_SERVER_URL => 'http://api.dbcapi.me/api';
use constant API_RESPONSE_TYPE => 'application/json
ccess forbidden, check your credentials"
);
}
my $user;
eval { $user = decode_json($response->content()); };
return (defined $user and 0 < $user->{"user"}) ? $user : undef;
}
Status::RC_OK == $response->code) {
my $captcha;
eval { $captcha = decode_json($response->content); };
if (defined $captcha and 0 < $captcha->{"captcha"}) {