-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDataDomeExample.java
More file actions
25 lines (19 loc) · 948 Bytes
/
DataDomeExample.java
File metadata and controls
25 lines (19 loc) · 948 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
package examples;
import com.twocaptcha.TwoCaptcha;
import com.twocaptcha.captcha.DataDome;
public class DataDomeExample {
public static void main(String[] args) {
TwoCaptcha solver = new TwoCaptcha(args[0]);
DataDome captcha = new DataDome();
captcha.setCaptchaUrl("https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAA...P~XFrBVptk&t=fe&referer=https%3A%2F%2Fhexample.com&s=45239&e=c538be..c510a00ea");
captcha.setUrl("https://example.com/");
captcha.setUserAgent("Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.3");
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());
}
}
}