-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathTspdExample.java
More file actions
26 lines (20 loc) · 888 Bytes
/
Copy pathTspdExample.java
File metadata and controls
26 lines (20 loc) · 888 Bytes
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
package examples;
import com.twocaptcha.TwoCaptcha;
import com.twocaptcha.captcha.Tspd;
public class TspdExample {
public static void main(String[] args) {
TwoCaptcha solver = new TwoCaptcha(args[0]);
Tspd captcha = new Tspd();
captcha.setPageUrl("https://example.com/page-with-tspd");
captcha.setTspdCookie("TS386a400d029=...");
captcha.setHtmlPageBase64("PCFET0NUWVBFIGh0bWw+...");
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());
}
}
}