Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#PHP and development related
.idea
/vendor
composer.phar

# Mac OS General
.DS_Store
Expand Down
12 changes: 12 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 [PHP c
- [Friendly Captcha](#friendly-captcha)
- [atbCAPTCHA](#atbcaptcha)
- [DataDome](#datadome)
- [CyberSiARA](#cybersiara)
- [Other methods](#other-methods)
- [send / getResult](#send--getresult)
- [balance](#balance)
Expand Down Expand Up @@ -333,6 +334,17 @@ $result = $solver->datadome([
]);
```

### CyberSiARA

Use this method to bypass CyberSiARA.

```php
$result = $solver->cybersiara([
'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
'pageurl' => 'https://demo.mycybersiara.com/',
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
]);
```


## Other methods
Expand Down
19 changes: 19 additions & 0 deletions examples/cybersiara.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

set_time_limit(130);

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

$solver = new \TwoCaptcha\TwoCaptcha('YOUR_API_KEY');

try {
$result = $solver->cybersiara([
'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
'pageurl' => 'https://demo.mycybersiara.com/',
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
]);
} catch (\Exception $e) {
die($e->getMessage());
}

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

use TwoCaptcha\TwoCaptcha;

set_time_limit(130);

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

$solver = new TwoCaptcha([
'apiKey' => 'YOUR_API_KEY',
'server' => 'http://2captcha.com'
]);

try {
$result = $solver->cybersiara([
'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
'pageurl' => 'https://demo.mycybersiara.com/',
'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);
17 changes: 17 additions & 0 deletions src/TwoCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,23 @@ public function rotate($captcha)
return $this->solve($captcha);
}

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

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/CyberSiaraTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace TwoCaptcha\Tests;

class CyberSiaraTest extends AbstractWrapperTestCase
{
protected $method = 'cybersiara';

public function testAllOptions()
{
$params = [
'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
'pageurl' => 'https://demo.mycybersiara.com/',
'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' => 'cybersiara',
'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
'pageurl' => 'https://demo.mycybersiara.com/',
'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' => [],
]);
}
}