-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathAmazonWafOptionsExample.java
31 lines (25 loc) · 1.09 KB
/
AmazonWafOptionsExample.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package examples;
import com.twocaptcha.TwoCaptcha;
import com.twocaptcha.captcha.AmazonWaf;
public class AmazonWafOptionsExample {
public static void main(String[] args) {
TwoCaptcha solver = new TwoCaptcha(args[0]);
solver.setHost("rucaptcha.com");
solver.setSoftId(0);
solver.setDefaultTimeout(120);
solver.setRecaptchaTimeout(600);
solver.setPollingInterval(10);
AmazonWaf captcha = new AmazonWaf();
captcha.setSiteKey("AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg");
captcha.setUrl("https://non-existent-example.execute-api.us-east-1.amazonaws.com");
captcha.setIV("test_iv");
captcha.setContext("test_context");
captcha.setProxy("HTTPS", "login:password@IP_address:PORT");
try {
solver.solve(captcha);
System.out.println("Captcha solved: " + captcha.getCode());
} catch (Exception e) {
System.out.println("Error occurred: " + e.getMessage());
}
}
}