diff --git a/.gitignore b/.gitignore index f22bb09..5da58d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ #PHP and development related .idea /vendor +composer.phar # Mac OS General .DS_Store diff --git a/README.md b/README.md index 5d1ce80..8fc5d5c 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 diff --git a/examples/cybersiara.php b/examples/cybersiara.php new file mode 100644 index 0000000..d6071dd --- /dev/null +++ b/examples/cybersiara.php @@ -0,0 +1,19 @@ +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); \ No newline at end of file diff --git a/examples/cybersiara_options.php b/examples/cybersiara_options.php new file mode 100644 index 0000000..af2109a --- /dev/null +++ b/examples/cybersiara_options.php @@ -0,0 +1,28 @@ + '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); \ No newline at end of file diff --git a/src/TwoCaptcha.php b/src/TwoCaptcha.php index 32496ef..cffd098 100644 --- a/src/TwoCaptcha.php +++ b/src/TwoCaptcha.php @@ -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. diff --git a/tests/CyberSiaraTest.php b/tests/CyberSiaraTest.php new file mode 100644 index 0000000..34e2241 --- /dev/null +++ b/tests/CyberSiaraTest.php @@ -0,0 +1,37 @@ + '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' => [], + ]); + } +}