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
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Examples of API requests for different captcha types are available on the [PHP c
- [atbCAPTCHA](#atbcaptcha)
- [DataDome](#datadome)
- [CyberSiARA](#cybersiara)
- [Prosopo](#prosopo)
- [Temu](#temu)
- [Captchafox](#captchafox)
- [Other methods](#other-methods)
- [send / getResult](#send--getresult)
- [balance](#balance)
Expand Down Expand Up @@ -444,6 +447,53 @@ $result = $solver->cybersiara([
]);
```

### Prosopo

<sup>[API method description.](https://2captcha.com/2captcha-api#prosopo-procaptcha)</sup>

Use this method to bypass Prosopo.

```php
$result = $solver->prosopo([
'sitekey' => '5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm',
'url' => 'https://www.twickets.live/',
]);
```


### Temu

<sup>[API method description.](https://2captcha.com/2captcha-api#temucaptcha)</sup>

Use this method to bypass Temu.

```php
$result = $solver->temu([
'body' => $body,
'part1' => $part1,
'part2' => $part2,
'part3' => $part3,
]);
```

### Captchafox

<sup>[API method description.](https://2captcha.com/2captcha-api#captchafox)</sup>

Use this method to bypass Captchafox.

```php
$result = $solver->captchafox([
'sitekey' => 'sk_ILKWNruBBVKDOM7dZs59KHnDLEWiH',
'url' => 'https://mysite.com/page/with/captchafox',
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
'proxy' => [
'type' => 'HTTPS',
'uri' => 'login:password@IP_address:PORT',
],
]);
```


## Other methods

Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"Cutcaptcha",
"Friendly Captcha",
"atbCAPTCHA",
"DataDome"
"DataDome",
"Prosopo",
"Temu",
"Captchafox"
],
"license": "MIT",
"authors": [
Expand Down
25 changes: 25 additions & 0 deletions examples/captchafox.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
use TwoCaptcha\TwoCaptcha;

set_time_limit(610);

require(__DIR__ . '/../src/autoloader.php');

//$argv[1] = YOUR_API_KEY
$solver = new TwoCaptcha($argv[1]);

try {
$result = $solver->captchafox([
'sitekey' => 'sk_ILKWNruBBVKDOM7dZs59KHnDLEWiH',
'url' => 'https://mysite.com/page/with/captchafox',
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
'proxy' => [
'type' => 'HTTPS',
'uri' => 'login:password@IP_address:PORT',
],
]);
} catch (\Exception $e) {
die($e->getMessage());
}

die('Captcha solved: ' . $result->code);
23 changes: 23 additions & 0 deletions examples/prosopo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

use TwoCaptcha\TwoCaptcha;

set_time_limit(610);

require(__DIR__ . '/../src/autoloader.php');

//$argv[1] = YOUR_API_KEY
$solver = new TwoCaptcha($argv[1]);

try {
$result = $solver->prosopo([
'sitekey' => '5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm',
'url' => 'https://www.twickets.live/',
]);

} catch (\Exception $e) {
die($e->getMessage());
}

die('Captcha solved: ' . $result->code);

Binary file added examples/resources/temu/body.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/resources/temu/part1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/resources/temu/part2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/resources/temu/part3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions examples/temu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use TwoCaptcha\TwoCaptcha;

set_time_limit(610);

require(__DIR__ . '/../src/autoloader.php');

//$argv[1] = YOUR_API_KEY
$solver = new TwoCaptcha($argv[1]);

$body = base64_encode(file_get_contents(__DIR__ . '/resources/temu/body.png'));
$part1 = base64_encode(file_get_contents(__DIR__ . '/resources/temu/part1.png'));
$part2 = base64_encode(file_get_contents(__DIR__ . '/resources/temu/part2.png'));
$part3 = base64_encode(file_get_contents(__DIR__ . '/resources/temu/part3.png'));


try {
$result = $solver->temu([
'body' => $body,
'part1' => $part1,
'part2' => $part2,
'part3' => $part3,
]);

} catch (\Exception $e) {
die($e->getMessage());
}

die('Captcha solved: ' . $result->code);

51 changes: 51 additions & 0 deletions src/TwoCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,57 @@ public function cybersiara($captcha)
return $this->solve($captcha);
}

/**
* Wrapper for solving Prosopo
*
* @param $captcha
* @return \stdClass
* @throws ApiException
* @throws NetworkException
* @throws TimeoutException
* @throws ValidationException
*/
public function prosopo($captcha)
{
$captcha['method'] = 'prosopo';

return $this->solve($captcha);
}

/**
* Wrapper for solving Temu
*
* @param $captcha
* @return \stdClass
* @throws ApiException
* @throws NetworkException
* @throws TimeoutException
* @throws ValidationException
*/
public function temu($captcha)
{
$captcha['method'] = 'temuimage';

return $this->solve($captcha);
}

/**
* Wrapper for solving Temu
*
* @param $captcha
* @return \stdClass
* @throws ApiException
* @throws NetworkException
* @throws TimeoutException
* @throws ValidationException
*/
public function captchafox($captcha)
{
$captcha['method'] = 'captchafox';

return $this->solve($captcha);
}

/**
* Sends captcha to `/in.php` and waits for it's result.
* This helper can be used insted of manual using of `send` and `getResult` functions.
Expand Down
37 changes: 37 additions & 0 deletions tests/CaptchafoxTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace TwoCaptcha\Tests;

class CaptchafoxTest extends AbstractWrapperTestCase
{
protected $method = 'captchafox';

public function testAllOptions()
{
$params = [
'sitekey' => 'sk_ILKWNruBBVKDOM7dZs59KHnDLEWiH',
'pageurl' => 'https://mysite.com/page/with/captchafox',
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
'proxy' => [
'type' => 'HTTPS',
'uri' => 'username:str0ngP@$$W0rd@1.2.3.4:4321',
]
];

$sendParams = [
'method' => 'captchafox',
'sitekey' => 'sk_ILKWNruBBVKDOM7dZs59KHnDLEWiH',
'pageurl' => 'https://mysite.com/page/with/captchafox',
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
'proxy' => 'username:str0ngP@$$W0rd@1.2.3.4:4321',
'proxytype' => 'HTTPS',
'soft_id' => '4585',
];

$this->checkIfCorrectParamsSendAndResultReturned([
'params' => $params,
'sendParams' => $sendParams,
'sendFiles' => [],
]);
}
}
35 changes: 35 additions & 0 deletions tests/ProsopoTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace TwoCaptcha\Tests;

class ProsopoTest extends AbstractWrapperTestCase
{
protected $method = 'prosopo';

public function testAllOptions()
{
$params = [
'sitekey' => '5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm',
'pageurl' => 'https://www.twickets.live/',
'proxy' => [
'type' => 'HTTPS',
'uri' => 'username:str0ngP@$$W0rd@1.2.3.4:4321',
]
];

$sendParams = [
'method' => 'prosopo',
'sitekey' => '5EZVvsHMrKCFKp5NYNoTyDjTjetoVo1Z4UNNbTwJf1GfN6Xm',
'pageurl' => 'https://www.twickets.live/',
'proxy' => 'username:str0ngP@$$W0rd@1.2.3.4:4321',
'proxytype' => 'HTTPS',
'soft_id' => '4585',
];

$this->checkIfCorrectParamsSendAndResultReturned([
'params' => $params,
'sendParams' => $sendParams,
'sendFiles' => [],
]);
}
}
41 changes: 41 additions & 0 deletions tests/TemuTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace TwoCaptcha\Tests;

class TemuTest extends AbstractWrapperTestCase
{
protected $method = 'temu';

public function test()
{
$body = base64_encode(file_get_contents(__DIR__ . '/../examples/resources/temu/body.png'));
$part1 = base64_encode(file_get_contents(__DIR__ . '/../examples/resources/temu/part1.png'));
$part2 = base64_encode(file_get_contents(__DIR__ . '/../examples/resources/temu/part2.png'));
$part3 = base64_encode(file_get_contents(__DIR__ . '/../examples/resources/temu/part3.png'));


$params = [
'body' => $body,
'part1' => $part1,
'part2' => $part2,
'part3' => $part3
];

$sendParams = [
'method' => 'temuimage',
'body' => $body,
'part1' => $part1,
'part2' => $part2,
'part3' => $part3,
'soft_id' => '4585',
];


$this->checkIfCorrectParamsSendAndResultReturned([
'params' => $params,
'sendParams' => $sendParams,
'sendFiles' => [],
]);
}

}