CAPTCHAFORUM
Administrator
imagetyperzapi is a super easy to use bypass captcha API wrapper for imagetyperz.com captcha service
Installation
git clone https://github.com/imagetyperz-api/imagetyperz-api-perl
How to use?
use ImageTyperzAPI;
There are 2 ways of authenticating with the server. With access_token or username and passord. We encourage you to use the token based authentication because it's more secure and username & password authentication might be removed at some point from the API libraries.
All the methods that end with _token will be used for token authentication
Get balance
ImageTyperzAPI::account_balance_token($access_token);
Image captcha
Submit image captcha
Code:
# without optional parameters
my $captcha_text = ImageTyperzAPI::solve_captcha_token($access_token, 'captcha.jpg', '1');
# with (all) optional parameters set
# token [or username & password if legacy], image, case sensitive, is phrase, is math, alphanumeric, minlength, maxlength, refid
my $captcha_text = ImageTyperzAPI::solve_captcha_token($access_token, 'captcha.jpg', 'true', 'true', 'true', '2', '1', '7');
reCAPTCHA
Submit recaptcha details
For recaptcha submission there are two things that are required.
- page_url
- site_key
- type - can be one of this 3 values: 1 - normal, 2 - invisible, 3 - v3 (it's optional, defaults to 1)
- v3_min_score - minimum score to target for v3 recaptcha - optional
- v3_action - action parameter to use for v3 recaptcha - optional
- proxy - proxy to use when solving recaptcha, eg. 12.34.56.78:1234 or 12.34.56.78:1234:userassword - optional
- user_agent - useragent to use when solve recaptcha - optional
Code:
my $recaptcha_params = [
token => $access_token,
#username => $username, # for legacy auth
#password => $password, # for legacy auth
action => 'UPLOADCAPTCHA',
pageurl => 'page_url_here',
googlekey => 'sitekey_here',
# v3
recaptchatype => '3', # optional, 1 - normal recaptcha, 2 - invisible recaptcha, 3 - v3 recaptcha, default: 1
captchaaction => 'homepage', # optional, used in solving v3 recaptcha
score => '0.3', # optional, min score to target when solving v3 recaptcha
# proxy
proxy => '12.34.54.56:123', # or '123.43.45.65:123:user:password' with auth - optional
proxytype => 'HTTP', # if proxy is used, un-comment this as well, only HTTP supported for now
# other optional parameters
useragent => 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0', # optional
'data-s' => 'recaptcha data-s value', # optional
affiliateid => '12344' # affiliate id - optional
];
my $captcha_id = ImageTyperzAPI::submit_recaptcha_token($recaptcha_params);
This method returns a captchaID. This ID will be used next, to retrieve the g-response, once workers have completed the captcha. This takes somewhere between 10-80 seconds.
Retrieve captcha response
Once you have the captchaID, you check for it's progress, and later on retrieve the gresponse.
The in_progress($access_token, $captcha_id) method will tell you if captcha is still being decoded by workers. Once it's no longer in progress, you can retrieve the gresponse with retrieve_recaptcha_token($access_token, $captcha_id)
Code:
while(ImageTyperzAPI::in_progress_token($access_token, $captcha_id))
{
sleep(10);# sleep for 10 seconds
}
my $gresponse = ImageTyperzAPI::retrieve_recaptcha_token($access_token, $captcha_id);
Documenatation https://github.com/imagetyperz-api/imagetyperz-api-perl