Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Examples of API requests for different captcha types are available on the [Java
- [atbCAPTCHA](#atbcaptcha)
- [CyberSiARA](#cybersiara)
- [DataDome](#datadome)
- [Prosopo](#prosopo)
- [Other methods](#other-methods)
- [send / getResult](#send--getresult)
- [balance](#balance)
Expand Down Expand Up @@ -496,6 +497,16 @@ captcha.setUserAgent("Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHT
captcha.setProxy("HTTPS", "login:password@IP_address:PORT");
```

### Prosopo
Use this method to solve Prosopo and obtain a token to bypass the protection.

```java
TwoCaptcha solver = new TwoCaptcha(args[0]); // args[0] = "API KEY"
Prosopo captcha = new Prosopo();
captcha.setSiteKey("5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm");
captcha.setUrl("https://www.twickets.live/");
```

## Other methods

### send / getResult
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/twocaptcha/captcha/Prosopo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.twocaptcha.captcha;

public class Prosopo extends Captcha {

public Prosopo() {
super();
params.put("method", "prosopo");
}

public void setSiteKey(String siteKey) {
params.put("sitekey", siteKey);
}

public void setUrl(String url) {
params.put("pageurl", url);
}

}
22 changes: 22 additions & 0 deletions src/main/java/examples/ProsopoExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package examples;

import com.twocaptcha.TwoCaptcha;
import com.twocaptcha.captcha.Prosopo;

public class ProsopoExample {

public static void main(String[] args) {
TwoCaptcha solver = new TwoCaptcha(args[0]);

Prosopo captcha = new Prosopo();
captcha.setSiteKey("5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm");
captcha.setUrl("https://www.twickets.live/");

try {
solver.solve(captcha);
System.out.println("Captcha solved: " + captcha.getCode());
} catch (Exception e) {
System.out.println("Error occurred: " + e.getMessage());
}
}
}
25 changes: 25 additions & 0 deletions src/test/java/com/twocaptcha/ProsopoTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.twocaptcha;

import com.twocaptcha.captcha.Prosopo;

import java.util.HashMap;
import java.util.Map;

public class ProsopoTest extends AbstractWrapperTestCase {

public void testAllOptions() throws Exception {
Prosopo captcha = new Prosopo();
captcha.setSiteKey("5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm");
captcha.setUrl("https://www.twickets.live/");

Map<String, String> params = new HashMap<>();
params.put("method", "prosopo");
params.put("sitekey", "5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm");
params.put("pageurl", "https://www.twickets.live/");
params.put("soft_id", "4581");
params.put("json", "0");

checkIfCorrectParamsSendAndResultReturned(captcha, params);
}

}