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-java
Dependencies
- org.apache.commons.cli
- org.json
Simply require the module, set the auth details and start using the captcha service:
import com.imagetyperzapi.ImageTyperzAPI;
Set access_token for authentication:
ImageTyperzAPI i = new ImageTyperzAPI("your_access_token");
Once you've set your authentication details, you can start using the API.
Get balance
String balance = i.account_balance();
System.out.println(String.format("Balance: %s", balance));
Solving
For solving a captcha, it's a two step process:
- submit captcha details - returns an ID
- use ID to check it's progress - and get solution when solved.
For getting the response, same method is used for all types.
Image captcha
Code:
HashMap<String, String> image_params = new HashMap<String, String>();
// image_params.put("iscase", "true"); // case sensitive captcha
// image_params.put("isphrase", "true"); // text contains at least one space (phrase)
// image_params.put("ismath", "true"); // instructs worker that a math captcha has to be solved
// image_params.put("alphanumeric", "2"); // 1 - digits only, 2 - letters only
// image_params.put("minlength", "1"); // captcha text length (minimum)
// image_params.put("maxlength", "8"); // captcha text length (maximum)
String captcha_id = i.submit_image("/tmp/captcha.jpg", image_params);
ID received is used to retrieve solution when solved.
Observation It works with URL instead of image file too, but authentication has to be done using token.
reCAPTCHA
For recaptcha submission there are two things that are required.
- page_url (required)
- site_key (required)
- type (optional, defaults to 1 if not given)
- 1 - v2
- 2 - invisible
- 3 - v3
- 4 - enterprise v2
- 5 - enterprise v3
- 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
- data-s - extra parameter used in solving recaptcha - optional
- cookie_input - cookies used in solving reCAPTCHA - - optional
Code:
HashMap<String, String> d = new HashMap<String, String>();
d.put("page_url", "https://your-site.com");
d.put("sitekey", "7LrGJmcUABBAALFtIb_FxC0LXm_GwOLyJAfbbUCL");
// d.put("type", "3"); // optional, 1 - regular, 2 - invisible, 3 - v3, defaults to 1
// d.put("v3_min_score", "0.1"); // optional
// d.put("v3_action", "homepage"); // optional
// d.put("proxy", "126.45.34.53:123"); // or with auth 126.45.34.53:123:user:pass - optional
// d.put("user_agent", "Your user agent"); // optional
// d.put("data-s", "recaptcha data-s value"); // optional
// d.put("cookie_input", "a=b;c=d"); // optional
String captcha_id = i.submit_recaptcha(d);
ID will be used to retrieve the g-response, once workers have completed the captcha. This takes somewhere between 10-80 seconds.
Check Retrieve response
Documentation https://github.com/imagetyperz-api/imagetyperz-api-java