-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathCaptchafoxExample.java
More file actions
27 lines (21 loc) · 961 Bytes
/
CaptchafoxExample.java
File metadata and controls
27 lines (21 loc) · 961 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
27
package examples;
import com.twocaptcha.TwoCaptcha;
import com.twocaptcha.captcha.Captchafox;
import com.twocaptcha.captcha.Turnstile;
public class CaptchafoxExample {
public static void main(String[] args) {
TwoCaptcha solver = new TwoCaptcha(args[0]);
Captchafox captcha = new Captchafox();
captcha.setSiteKey("sk_ILKWNruBBVKDOM7dZs59KHnDLEWiH");
captcha.setUrl("https://mysite.com/page/with/captchafox");
captcha.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36");
captcha.setProxy("HTTPS", "login:password@IP_address:PORT");
captcha.setApiServer("https://mam.example.com");
try {
solver.solve(captcha);
System.out.println("Captcha solved: " + captcha.getCode());
} catch (Exception e) {
System.out.println("Error occurred: " + e.getMessage());
}
}
}