-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dmitry Gladyshev
committed
Mar 10, 2022
1 parent
794be79
commit a2f8a2a
Showing
25 changed files
with
419 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$configuration = \Anticaptcha\Configuration::fromClientKey( | ||
getenv('__ANTICAPTCHA_KEY__') | ||
); | ||
|
||
$httpClient = new \GuzzleHttp\Client(); | ||
|
||
$client = new \Anticaptcha\Client( | ||
$configuration, | ||
$httpClient | ||
); | ||
|
||
$task = new \Anticaptcha\Task\AntiGateTask([ | ||
'websiteURL' => 'http://antigate.com/logintest.php', | ||
'templateName' => 'Sign-in and wait for control text', | ||
'variables' => [ | ||
"login_input_css" => "#login", | ||
"login_input_value" => "the login", | ||
"password_input_css" => "#password", | ||
"password_input_value" => "test password", | ||
"control_text" => "You have been logged successfully" | ||
] | ||
]); | ||
|
||
$createTaskResponse = $client->createTask($task); | ||
|
||
$getTaskResponse = $client->getTaskResult($createTaskResponse->getTaskId()); | ||
$getTaskResponse->wait(5, 600); | ||
|
||
var_dump( | ||
$getTaskResponse->getTaskId(), | ||
$getTaskResponse->solution | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Anticaptcha\Task; | ||
|
||
class AntiGateTask extends AbstractTask | ||
{ | ||
/* | ||
* Address of a target web page. Can be located anywhere on the web site, even in a member area. Our workers don't | ||
* navigate there but simulate the visit instead. | ||
*/ | ||
public string $websiteURL; | ||
|
||
/* | ||
* Name of a scenario template from our database. You can use an existing template or create your own. You may | ||
* search for an existing template below this table. | ||
*/ | ||
public string $templateName; | ||
|
||
/* | ||
* An object containing template's variables and their values. | ||
*/ | ||
public array $variables; | ||
|
||
/* | ||
* Proxy IP address ipv4/ipv6. No host names or IP addresses from local networks. | ||
*/ | ||
public ?string $proxyAddress = null; | ||
|
||
/* | ||
* Proxy port | ||
*/ | ||
public ?int $proxyPort = null; | ||
|
||
/* | ||
* Login for proxy which requires authorization (basic) | ||
*/ | ||
public ?string $proxyLogin = null; | ||
|
||
/* | ||
* Proxy password | ||
*/ | ||
public ?string $proxyPassword = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Anticaptcha\Task; | ||
|
||
class FunCaptchaTask extends FunCaptchaTaskProxyless | ||
{ | ||
use ProxyTrait; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Anticaptcha\Task; | ||
|
||
class FunCaptchaTaskProxyless extends AbstractTask | ||
{ | ||
/* | ||
* Address of a target web page. Can be located anywhere on the web site, even in a member area. Our workers don't | ||
* navigate there but simulate the visit instead. | ||
*/ | ||
public string $websiteURL; | ||
|
||
/* | ||
* Arkose Labs public key | ||
*/ | ||
public string $websitePublicKey; | ||
|
||
/* | ||
* Custom Arkose Labs subdomain from which the Javascript widget is loaded. Required for some cases, but most | ||
* Arkose Labs integrations run without it. | ||
*/ | ||
public ?string $funcaptchaApiJSSubdomain = null; | ||
|
||
/* | ||
* An additional parameter that may be required by Arkose Labs implementation. Use this property to send "blob" | ||
* value as an object converted to a string. See an example of what it might look like. | ||
* {"\blob\":\"HERE_COMES_THE_blob_VALUE\"} | ||
*/ | ||
public ?string $data = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Anticaptcha\Task; | ||
|
||
class GeeTestTask extends GeeTestTaskProxyless | ||
{ | ||
use ProxyTrait; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Anticaptcha\Task; | ||
|
||
class GeeTestTaskProxyless extends AbstractTask | ||
{ | ||
/* | ||
* Address of a target web page. Can be located anywhere on the web site, even in a member area. Our workers don't | ||
* navigate there but simulate the visit instead. | ||
*/ | ||
public string $websiteURL; | ||
|
||
/* | ||
* The domain public key, rarely updated. | ||
*/ | ||
public string $gt; | ||
|
||
/* | ||
* Changing token key. Make sure you grab a fresh one for each captcha; otherwise, you'll be charged for an error | ||
* task. | ||
*/ | ||
public string $challenge; | ||
|
||
/* | ||
* Optional API subdomain. May be required for some implementations. | ||
*/ | ||
public ?string $geetestApiServerSubdomain = null; | ||
|
||
/* | ||
* Required for some implementations. Send the JSON encoded into a string. The value can be traced in browser | ||
* developer tools. Put a breakpoint before calling the "initGeetest" function. | ||
*/ | ||
public ?string $geetestGetLib = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Anticaptcha\Task; | ||
|
||
class HCaptchaTask extends HCaptchaTaskProxyless | ||
{ | ||
use ProxyTrait; | ||
} |
Oops, something went wrong.