public class TwoCaptcha extends Object
| Constructor and Description |
|---|
TwoCaptcha()
TwoCaptcha constructor
|
TwoCaptcha(String apiKey)
TwoCaptcha constructor
|
| Modifier and Type | Method and Description |
|---|---|
double |
balance()
Gets account's balance
|
String |
getResult(String id)
Returns result of captcha if it was solved or `null`, if result is not ready
|
void |
report(String id,
boolean correct)
Reports if captcha was solved correctly (sends `reportbad` or `reportgood` to `/res.php`)
|
String |
send(Captcha captcha)
Sends captcha to '/in.php', and returns its `id`
|
void |
setApiKey(String apiKey) |
void |
setCallback(String callback) |
void |
setDefaultTimeout(int timeout) |
void |
setHttpClient(ApiClient apiClient) |
void |
setPollingInterval(int interval) |
void |
setRecaptchaTimeout(int timeout) |
void |
setSoftId(int softId) |
void |
solve(Captcha captcha)
Sends captcha to `/in.php` and waits for it's result.
|
void |
solve(Captcha captcha,
Map<String,Integer> waitOptions)
Sends captcha to `/in.php` and waits for it's result.
|
void |
waitForResult(Captcha captcha,
Map<String,Integer> waitOptions)
This helper waits for captcha result, and when result is ready, returns it
|
public TwoCaptcha()
public TwoCaptcha(String apiKey)
apiKey - public void setApiKey(String apiKey)
apiKey - public void setSoftId(int softId)
softId - public void setCallback(String callback)
callback - public void setDefaultTimeout(int timeout)
timeout - public void setRecaptchaTimeout(int timeout)
timeout - public void setPollingInterval(int interval)
interval - public void setHttpClient(ApiClient apiClient)
apiClient - public void solve(Captcha captcha) throws Exception
captcha - Exceptionpublic void solve(Captcha captcha, Map<String,Integer> waitOptions) throws Exception
captcha - waitOptions - Exceptionpublic void waitForResult(Captcha captcha, Map<String,Integer> waitOptions) throws Exception
captcha - waitOptions - Exceptionpublic String send(Captcha captcha) throws Exception
captcha - Exceptionpublic String getResult(String id) throws Exception
id - ExceptionCopyright © 2020. All rights reserved.