-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathBasiliskOptionsExample.java
More file actions
30 lines (24 loc) · 1.02 KB
/
Copy pathBasiliskOptionsExample.java
File metadata and controls
30 lines (24 loc) · 1.02 KB
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
package examples;
import com.twocaptcha.TwoCaptcha;
import com.twocaptcha.captcha.Basilisk;
public class BasiliskOptionsExample {
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);
Basilisk captcha = new Basilisk();
captcha.setSiteKey("b7890h...19fb2600897");
captcha.setPageUrl("https://example.com/page-with-basilisk");
captcha.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36");
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());
}
}
}