-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExampleCutcaptcha.java
More file actions
84 lines (70 loc) · 3.14 KB
/
Copy pathExampleCutcaptcha.java
File metadata and controls
84 lines (70 loc) · 3.14 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package examples;
import java.io.IOException;
import org.json.JSONObject;
import com.DeathByCaptcha.Captcha;
import com.DeathByCaptcha.Client;
import com.DeathByCaptcha.SocketClient;
public class ExampleCutcaptcha {
public static void main(String[] args)
throws Exception {
// Put your DBC username & password or authtoken here:
String username = "your_username_here";
String password = "your_password_here";
String authtoken = "your_authtoken_here";
//Death By Captcha Socket Client
Client client = (Client) (new SocketClient(username, password));
//Death By Captcha http Client
// Client client = (Client) (new HttpClient(username, password));
client.isVerbose = true;
/* Using authtoken
Client client = (Client) new HttpClient(authtoken); */
try {
try {
System.out.println("Your balance is " + client.getBalance() + " US cents");
} catch (IOException e) {
System.out.println("Failed fetching balance: " + e.toString());
return;
}
Captcha captcha = null;
try {
// Proxy and cutcaptcha data
String proxy = "";
String proxytype = "";
String apikey = "SAs61IAI";
String pageurl = "https://filecrypt.cc/Contact.html";
String miserykey = "56a9e9b989aa8cf99e0cea28d4b4678b84fa7a4e";
/* Upload a cutcaptcha and poll for its status with 120 seconds timeout.
Put your proxy, proxy type, page apikey, miserykey, page url */
JSONObject json_params = new JSONObject();
json_params.put("proxy", proxy);
json_params.put("proxytype", proxytype);
json_params.put("apikey", apikey);
json_params.put("pageurl", pageurl);
json_params.put("miserykey", miserykey);
captcha = client.decode(19, json_params);
} catch (IOException e) {
System.out.println("Failed uploading CAPTCHA");
return;
}
if (null != captcha) {
System.out.println("CAPTCHA " + captcha.id + " solved: " + captcha.text);
/* Report incorrectly solved CAPTCHA if necessary.
Make sure you've checked if the CAPTCHA was in fact incorrectly
solved, or else you might get banned as abuser. */
/*try {
if (client.report(captcha)) {
System.out.println("Reported as incorrectly solved");
} else {
System.out.println("Failed reporting incorrectly solved CAPTCHA");
}
} catch (IOException e) {
System.out.println("Failed reporting incorrectly solved CAPTCHA: " + e.toString());
}*/
} else {
System.out.println("Failed solving CAPTCHA");
}
} catch (com.DeathByCaptcha.Exception e) {
System.out.println(e);
}
}
}