Skip to content

Commit 7999ffc

Browse files
New captchas (#23)
* Cutcaptcha * AtbCAPTCHA * Cybersiara * Cybersiara * DataDome * Update README.md * refactor * Update Lemin URL --------- Co-authored-by: dzmitry-duboyski <[email protected]>
1 parent 3888225 commit 7999ffc

18 files changed

+347
-7
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ hs_err_pid*
2424

2525
# Intellij IDEA
2626
.idea
27+
.run
2728

2829
.classpath
2930
.project
3031
.settings/
3132
target/
32-
settings.xml
33+
settings.xml

README.md

+46-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ Examples of API requests for different captcha types are available on the [Java
3939
- [Friendly Captcha](#friendly-captcha)
4040
- [MTCaptcha](#mtcaptcha)
4141
- [Tencent](#tencent)
42+
- [Cutcaptcha](#cutcaptcha)
43+
- [AtbCAPTCHA](#atbcaptcha)
44+
- [CyberSiARA](#cybersiara)
45+
- [DataDome](#datadome)
4246
- [Other methods](#other-methods)
4347
- [send / getResult](#send--getresult)
4448
- [balance](#balance)
@@ -316,7 +320,7 @@ Use this method to solve Lemin and obtain a token to bypass the protection.
316320
TwoCaptcha solver = new TwoCaptcha(args[0]);
317321
Lemin captcha = new Lemin();
318322
captcha.setСaptchaId("CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d");
319-
captcha.setUrl("http://sat2.aksigorta.com.tr");
323+
captcha.setUrl("https://mysite.com/page/with/LeminCaptcha");
320324
captcha.setApiServer("api.leminnow.com");
321325
```
322326

@@ -371,6 +375,47 @@ Tencent tencent = new Tencent();
371375
tencent.setAppId("2092215077");
372376
tencent.setPageUrl("https://mysite.com/page/with/tencent");
373377
```
378+
### Cutcaptcha
379+
Use this method to solve Cutcaptcha and obtain a token to bypass the protection.
380+
381+
```java
382+
TwoCaptcha solver = new TwoCaptcha(args[0]);
383+
Cutcaptcha cutcaptcha = new Cutcaptcha();
384+
cutcaptcha.setMiseryKey("a1488b66da00bf332a1488993a5443c79047e752");
385+
cutcaptcha.setUrl("https://filecrypt.co/Container/237D4D0995.html");
386+
cutcaptcha.setDataApiKey("SAb83IIB");
387+
```
388+
389+
### AtbCAPTCHA
390+
Use this method to solve AtbCAPTCHA and obtain a token to bypass the protection.
391+
392+
```java
393+
AtbCAPTCHA captcha = new AtbCAPTCHA();
394+
captcha.setAppId("af23e041b22d000a11e22a230fa8991c");
395+
captcha.setPageUrl("https://www.playzone.vip/");
396+
captcha.setApiServer("https://cap.aisecurius.com");
397+
```
398+
399+
### CyberSiARA
400+
Use this method to solve Cybersiara and obtain a token to bypass the protection.
401+
402+
```java
403+
Cybersiara captcha = new Cybersiara();
404+
captcha.setMasterUrlId("tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv");
405+
captcha.setUrl("https://demo.mycybersiara.com/");
406+
captcha.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36");
407+
```
408+
409+
### DataDome
410+
Use this method to solve DataDome and obtain a token to bypass the protection.
411+
412+
```java
413+
DataDome captcha = new DataDome();
414+
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");
415+
captcha.setUrl("https://example.com/");
416+
captcha.setUserAgent("Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.3");
417+
captcha.setProxy("HTTPS", "login:password@IP_address:PORT");
418+
```
374419

375420
## Other methods
376421

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<version>1.2.0</version>
1010

1111
<name>2captcha-java</name>
12-
<description>Java library for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.</description>
12+
<description>Java library for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, funcaptcha, geetest and solve any other captchas.</description>
1313
<url>https://2captcha.com/</url>
1414

1515
<licenses>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.twocaptcha.captcha;
2+
3+
public class AtbCAPTCHA extends Captcha {
4+
5+
public AtbCAPTCHA() {
6+
super();
7+
params.put("method", "atb_captcha");
8+
}
9+
10+
public void setAppId(String appId) {
11+
params.put("app_id", appId);
12+
}
13+
14+
public void setApiServer(String apiServer) {
15+
params.put("api_server", apiServer);
16+
}
17+
18+
public void setPageUrl(String url) {
19+
params.put("pageurl", url);
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.twocaptcha.captcha;
2+
3+
public class Cutcaptcha extends Captcha {
4+
5+
public Cutcaptcha() {
6+
super();
7+
params.put("method", "cutcaptcha");
8+
}
9+
10+
public void setMiseryKey(String miseryKey) {
11+
params.put("misery_key", miseryKey);
12+
}
13+
14+
public void setUrl(String url) {
15+
params.put("pageurl", url);
16+
}
17+
18+
public void setDataApiKey(String dataApiKey) {
19+
params.put("api_key", dataApiKey);
20+
}
21+
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.twocaptcha.captcha;
2+
3+
public class Cybersiara extends Captcha {
4+
5+
public Cybersiara() {
6+
super();
7+
params.put("method", "cybersiara");
8+
}
9+
10+
public void setMasterUrlId(String masterUrlId)
11+
{
12+
params.put("master_url_id", masterUrlId);
13+
}
14+
15+
public void setUrl(String url) {
16+
params.put("pageurl", url);
17+
}
18+
19+
public void setUserAgent(String userAgent) {
20+
params.put("userAgent", userAgent);
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.twocaptcha.captcha;
2+
3+
public class DataDome extends Captcha {
4+
5+
public DataDome() {
6+
super();
7+
params.put("method", "datadome");
8+
}
9+
10+
public void setUrl(String url) {
11+
params.put("pageurl", url);
12+
}
13+
14+
public void setCaptchaUrl(String capthaUrl)
15+
{
16+
params.put("captcha_url", capthaUrl);
17+
}
18+
19+
public void setUserAgent(String userAgent) {
20+
params.put("userAgent", userAgent);
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package examples;
2+
3+
import com.twocaptcha.TwoCaptcha;
4+
import com.twocaptcha.captcha.AtbCAPTCHA;
5+
6+
public class AtbCAPTCHAExample {
7+
8+
public static void main(String[] args) {
9+
TwoCaptcha solver = new TwoCaptcha(args[0]);
10+
11+
AtbCAPTCHA captcha = new AtbCAPTCHA();
12+
captcha.setAppId("af23e041b22d000a11e22a230fa8991c");
13+
captcha.setPageUrl("https://www.playzone.vip/");
14+
captcha.setApiServer("https://cap.aisecurius.com");
15+
16+
try {
17+
solver.solve(captcha);
18+
System.out.println("Captcha solved: " + captcha.getCode());
19+
} catch (Exception e) {
20+
System.out.println("Error occurred: " + e.getMessage());
21+
}
22+
}
23+
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package examples;
2+
3+
import com.twocaptcha.TwoCaptcha;
4+
import com.twocaptcha.captcha.Cutcaptcha;
5+
6+
public class CutcaptchaExample {
7+
8+
public static void main(String[] args) {
9+
TwoCaptcha solver = new TwoCaptcha(args[0]);
10+
11+
Cutcaptcha cutcaptcha = new Cutcaptcha();
12+
cutcaptcha.setMiseryKey("a1488b66da00bf332a1488993a5443c79047e752");
13+
cutcaptcha.setUrl("https://filecrypt.co/Container/237D4D0995.html");
14+
cutcaptcha.setDataApiKey("SAb83IIB");
15+
16+
try {
17+
solver.solve(cutcaptcha);
18+
System.out.println("Captcha solved: " + cutcaptcha.getCode());
19+
} catch (Exception e) {
20+
System.out.println("Error occurred: " + e.getMessage());
21+
}
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package examples;
2+
3+
import com.twocaptcha.TwoCaptcha;
4+
import com.twocaptcha.captcha.Cybersiara;
5+
6+
public class CybersiaraExample {
7+
8+
public static void main(String[] args) {
9+
TwoCaptcha solver = new TwoCaptcha(args[0]);
10+
11+
Cybersiara captcha = new Cybersiara();
12+
captcha.setMasterUrlId("tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv");
13+
captcha.setUrl("https://demo.mycybersiara.com/");
14+
captcha.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36");
15+
16+
try {
17+
solver.solve(captcha);
18+
System.out.println("Captcha solved: " + captcha.getCode());
19+
} catch (Exception e) {
20+
System.out.println("Error occurred: " + e.getMessage());
21+
}
22+
}
23+
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package examples;
2+
3+
import com.twocaptcha.TwoCaptcha;
4+
import com.twocaptcha.captcha.DataDome;
5+
6+
public class DataDomeExample {
7+
8+
public static void main(String[] args) {
9+
TwoCaptcha solver = new TwoCaptcha(args[0]);
10+
11+
DataDome captcha = new DataDome();
12+
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");
13+
captcha.setUrl("https://example.com/");
14+
captcha.setUserAgent("Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.3");
15+
captcha.setProxy("HTTPS", "login:password@IP_address:PORT");
16+
17+
try {
18+
solver.solve(captcha);
19+
System.out.println("Captcha solved: " + captcha.getCode());
20+
} catch (Exception e) {
21+
System.out.println("Error occurred: " + e.getMessage());
22+
}
23+
}
24+
25+
}

src/main/java/examples/LeminExample.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static void main(String[] args) {
1010

1111
Lemin captcha = new Lemin();
1212
captcha.setСaptchaId("CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d");
13-
captcha.setUrl("http://sat2.aksigorta.com.tr");
13+
captcha.setUrl("https://mysite.com/page/with/LeminCaptcha");
1414
captcha.setApiServer("api.leminnow.com");
1515

1616
try {

src/main/java/examples/LeminOptionsExample.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static void main(String[] args) {
1414

1515
Lemin captcha = new Lemin();
1616
captcha.setСaptchaId("CROPPED_d3d4d56_73ca4008925b4f83a8bed59c2dd0df6d");
17-
captcha.setUrl("http://sat2.aksigorta.com.tr");
17+
captcha.setUrl("https://mysite.com/page/with/LeminCaptcha");
1818
captcha.setApiServer("api.leminnow.com");
1919
captcha.setProxy("HTTPS", "login:password@IP_address:PORT");
2020

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.twocaptcha;
2+
3+
import com.twocaptcha.captcha.AtbCAPTCHA;
4+
import com.twocaptcha.captcha.Capy;
5+
6+
import java.util.HashMap;
7+
import java.util.Map;
8+
9+
public class AtbCAPTCHATest extends AbstractWrapperTestCase {
10+
11+
public void testAllOptions() throws Exception {
12+
AtbCAPTCHA captcha = new AtbCAPTCHA();
13+
captcha.setAppId("af23e041b22d000a11e22a230fa8991c");
14+
captcha.setPageUrl("https://www.playzone.vip/");
15+
captcha.setApiServer("https://cap.aisecurius.com");
16+
17+
Map<String, String> params = new HashMap<>();
18+
params.put("method", "atb_captcha");
19+
params.put("app_id", "af23e041b22d000a11e22a230fa8991c");
20+
params.put("pageurl", "https://www.playzone.vip/");
21+
params.put("api_server","https://cap.aisecurius.com");
22+
params.put("soft_id", "4581");
23+
params.put("json", "0");
24+
25+
checkIfCorrectParamsSendAndResultReturned(captcha, params);
26+
}
27+
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.twocaptcha;
2+
3+
import com.twocaptcha.captcha.Capy;
4+
import com.twocaptcha.captcha.Cutcaptcha;
5+
6+
import java.util.HashMap;
7+
import java.util.Map;
8+
9+
public class CutcaptchaTest extends AbstractWrapperTestCase {
10+
11+
public void testAllOptions() throws Exception {
12+
Cutcaptcha cutcaptcha = new Cutcaptcha();
13+
cutcaptcha.setMiseryKey("a1488b66da00bf332a1488993a5443c79047e752");
14+
cutcaptcha.setUrl("https://filecrypt.co/Container/237D4D0995.html");
15+
cutcaptcha.setDataApiKey("SAb83IIB");
16+
17+
Map<String, String> params = new HashMap<>();
18+
params.put("method", "cutcaptcha");
19+
params.put("misery_key", "a1488b66da00bf332a1488993a5443c79047e752");
20+
params.put("pageurl", "https://filecrypt.co/Container/237D4D0995.html");
21+
params.put("api_key","SAb83IIB");
22+
params.put("soft_id", "4581");
23+
params.put("json", "0");
24+
25+
checkIfCorrectParamsSendAndResultReturned(cutcaptcha, params);
26+
}
27+
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.twocaptcha;
2+
3+
import com.twocaptcha.captcha.Cybersiara;
4+
5+
import java.util.HashMap;
6+
import java.util.Map;
7+
8+
public class CybersiaraTest extends AbstractWrapperTestCase {
9+
10+
public void testAllOptions() throws Exception {
11+
Cybersiara captcha = new Cybersiara();
12+
captcha.setMasterUrlId("tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv");
13+
captcha.setUrl("https://demo.mycybersiara.com/");
14+
captcha.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36");
15+
16+
Map<String, String> params = new HashMap<>();
17+
params.put("method", "cybersiara");
18+
params.put("master_url_id", "tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv");
19+
params.put("pageurl", "https://demo.mycybersiara.com/");
20+
params.put("userAgent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36");
21+
params.put("soft_id", "4581");
22+
params.put("json", "0");
23+
24+
checkIfCorrectParamsSendAndResultReturned(captcha, params);
25+
}
26+
}

0 commit comments

Comments
 (0)