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
2 changes: 1 addition & 1 deletion examples/amazon_waf_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'proxy' => [
'type' => 'HTTPS',
'uri' => 'login:password@IP_address:PORT',
],
],
]);
} catch (\Exception $e) {
die($e->getMessage());
Expand Down
2 changes: 1 addition & 1 deletion examples/turnstile_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'proxy' => [
'type' => 'HTTPS',
'uri' => 'login:password@IP_address:PORT',
],
],
]);
} catch (\Exception $e) {
die($e->getMessage());
Expand Down
2 changes: 1 addition & 1 deletion examples/yandex_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'proxy' => [
'type' => 'HTTPS',
'uri' => 'login:password@IP_address:PORT',
],
],
]);
} catch (\Exception $e) {
die($e->getMessage());
Expand Down
22 changes: 11 additions & 11 deletions src/TwoCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function yandex($captcha)

return $this->solve($captcha, ['timeout' => $this->recaptchaTimeout]);
}

/**
* Wrapper for solving Turnstile
*
Expand Down Expand Up @@ -274,7 +274,7 @@ public function geetest_v4($captcha)

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


/**
* Wrapper for solving hCaptcha
Expand Down Expand Up @@ -308,7 +308,7 @@ public function lemin($captcha)
$captcha['method'] = 'lemin';

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

/**
* Wrapper for solving KeyCaptcha
Expand Down Expand Up @@ -395,8 +395,8 @@ public function canvas($captcha)

if ( empty($captcha['hintText']) && empty($captcha['hintImg']) ) {
throw new ValidationException('At least one of parameters: hintText or hintImg required!');
}
}

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

Expand Down Expand Up @@ -434,21 +434,21 @@ public function coordinates($captcha)
* @throws ApiException
* @throws NetworkException
* @throws TimeoutException
* @throws ValidationException
* @throws ValidationException
*/
public function audio($captcha){
if (is_string($captcha)) {
if (!file_exists($captcha)) {
throw new ValidationException('File not found (' . $captcha . ')');
}
}
$body = file_get_contents($captcha);
$body = base64_encode($body);

$captcha = [
'body' => $body,
];
}
}

$captcha['method'] = 'audio';
return $this->solve($captcha);
}
Expand All @@ -468,9 +468,9 @@ public function rotate($captcha)
if (is_string($captcha)) {
if (!file_exists($captcha)) {
throw new ValidationException('File not found (' . $captcha . ')');
}
}
$body = file_get_contents($captcha);
$body = base64_encode($body);
$body = base64_encode($body);
$captcha = [
'body' => $body,
];
Expand Down
2 changes: 1 addition & 1 deletion tests/AmazonWafTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function testAllOptions()
'sitekey' => 'AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg',
'pageurl' => 'https://non-existent-example.execute-api.us-east-1.amazonaws.com',
'iv' => 'test_iv',
'context' => 'test_context',
'context' => 'test_context',
'proxy' => [
'type' => 'HTTPS',
'uri' => 'username:str0ngP@$$W0rd@1.2.3.4:4321',
Expand Down
2 changes: 1 addition & 1 deletion tests/FunCaptchaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testAllOptions()
'proxy' => [
'type' => 'HTTPS',
'uri' => 'username:str0ngP@$$W0rd@1.2.3.4:4321',
]
]
];

$sendParams = [
Expand Down
2 changes: 1 addition & 1 deletion tests/GeeTestV4.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testAllOptions()
'soft_id' => '4585',
];



$this->checkIfCorrectParamsSendAndResultReturned([
'params' => $params,
Expand Down
2 changes: 1 addition & 1 deletion tests/autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
$relativeClass = substr($class, $len);

$file = __DIR__ . '/../src/' . str_replace('\\', '/', $relativeClass) . '.php';

if (file_exists($file)) require $file;
});