Skip to content

Commit 348255a

Browse files
Merge pull request #24 from 2captcha/RC-2939_cybersiara
CyberSiARA
2 parents 5cba8ff + 1b99370 commit 348255a

6 files changed

Lines changed: 114 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#PHP and development related
22
.idea
33
/vendor
4+
composer.phar
45

56
# Mac OS General
67
.DS_Store

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Examples of API requests for different captcha types are available on the [PHP c
4242
- [Friendly Captcha](#friendly-captcha)
4343
- [atbCAPTCHA](#atbcaptcha)
4444
- [DataDome](#datadome)
45+
- [CyberSiARA](#cybersiara)
4546
- [Other methods](#other-methods)
4647
- [send / getResult](#send--getresult)
4748
- [balance](#balance)
@@ -325,6 +326,17 @@ $result = $solver->datadome([
325326
]);
326327
```
327328

329+
### CyberSiARA
330+
331+
Use this method to bypass CyberSiARA.
332+
333+
```php
334+
$result = $solver->cybersiara([
335+
'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
336+
'pageurl' => 'https://demo.mycybersiara.com/',
337+
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
338+
]);
339+
```
328340

329341

330342
## Other methods

examples/cybersiara.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
set_time_limit(130);
4+
5+
require(__DIR__ . '/../src/autoloader.php');
6+
7+
$solver = new \TwoCaptcha\TwoCaptcha('YOUR_API_KEY');
8+
9+
try {
10+
$result = $solver->cybersiara([
11+
'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
12+
'pageurl' => 'https://demo.mycybersiara.com/',
13+
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
14+
]);
15+
} catch (\Exception $e) {
16+
die($e->getMessage());
17+
}
18+
19+
die('Captcha solved: ' . $result->code);

examples/cybersiara_options.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use TwoCaptcha\TwoCaptcha;
4+
5+
set_time_limit(130);
6+
7+
require(__DIR__ . '/../src/autoloader.php');
8+
9+
$solver = new TwoCaptcha([
10+
'apiKey' => 'YOUR_API_KEY',
11+
'server' => 'http://2captcha.com'
12+
]);
13+
14+
try {
15+
$result = $solver->cybersiara([
16+
'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
17+
'pageurl' => 'https://demo.mycybersiara.com/',
18+
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
19+
'proxy' => [
20+
'type' => 'HTTPS',
21+
'uri' => 'login:password@IP_address:PORT',
22+
],
23+
]);
24+
} catch (\Exception $e) {
25+
die($e->getMessage());
26+
}
27+
28+
die('Captcha solved: ' . $result->code);

src/TwoCaptcha.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,23 @@ public function rotate($captcha)
584584
return $this->solve($captcha);
585585
}
586586

587+
/**
588+
* Wrapper for solving CyberSiARA
589+
*
590+
* @param $captcha
591+
* @return \stdClass
592+
* @throws ApiException
593+
* @throws NetworkException
594+
* @throws TimeoutException
595+
* @throws ValidationException
596+
*/
597+
public function cybersiara($captcha)
598+
{
599+
$captcha['method'] = 'cybersiara';
600+
601+
return $this->solve($captcha);
602+
}
603+
587604
/**
588605
* Sends captcha to `/in.php` and waits for it's result.
589606
* This helper can be used insted of manual using of `send` and `getResult` functions.

tests/CyberSiaraTest.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace TwoCaptcha\Tests;
4+
5+
class CyberSiaraTest extends AbstractWrapperTestCase
6+
{
7+
protected $method = 'cybersiara';
8+
9+
public function testAllOptions()
10+
{
11+
$params = [
12+
'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
13+
'pageurl' => 'https://demo.mycybersiara.com/',
14+
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
15+
'proxy' => [
16+
'type' => 'HTTPS',
17+
'uri' => 'username:str0ngP@$$W0rd@1.2.3.4:4321',
18+
]
19+
];
20+
21+
$sendParams = [
22+
'method' => 'cybersiara',
23+
'master_url_id' => 'tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
24+
'pageurl' => 'https://demo.mycybersiara.com/',
25+
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36',
26+
'proxy' => 'username:str0ngP@$$W0rd@1.2.3.4:4321',
27+
'proxytype' => 'HTTPS',
28+
'soft_id' => '4585',
29+
];
30+
31+
$this->checkIfCorrectParamsSendAndResultReturned([
32+
'params' => $params,
33+
'sendParams' => $sendParams,
34+
'sendFiles' => [],
35+
]);
36+
}
37+
}

0 commit comments

Comments
 (0)