Skip to content

Commit

Permalink
Added hCaptchaTask and squareNetTask
Browse files Browse the repository at this point in the history
  • Loading branch information
Anti Admin committed Mar 27, 2020
1 parent a5ca0b2 commit f452cd5
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 0 deletions.
74 changes: 74 additions & 0 deletions hcaptcha.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

class HCaptcha extends Anticaptcha implements AntiCaptchaTaskProtocol {

private $websiteUrl;
private $websiteKey;
private $proxyType = "http";
private $proxyAddress;
private $proxyPort;
private $proxyLogin;
private $proxyPassword;
private $userAgent = "";
private $cookies = "";

public function getPostData() {
return array(
"type" => "NoCaptchaTask",
"websiteURL" => $this->websiteUrl,
"websiteKey" => $this->websiteKey,
"proxyType" => $this->proxyType,
"proxyAddress" => $this->proxyAddress,
"proxyPort" => $this->proxyPort,
"proxyLogin" => $this->proxyLogin,
"proxyPassword" => $this->proxyPassword,
"userAgent" => $this->userAgent,
"cookies" => $this->cookies
);
}

public function setTaskInfo($taskInfo) {
$this->taskInfo = $taskInfo;
}

public function getTaskSolution() {
return $this->taskInfo->solution->gRecaptchaResponse;
}

public function setWebsiteURL($value) {
$this->websiteUrl = $value;
}

public function setWebsiteKey($value) {
$this->websiteKey = $value;
}

public function setProxyType($value) {
$this->proxyType = $value;
}

public function setProxyAddress($value) {
$this->proxyAddress = $value;
}

public function setProxyPort($value) {
$this->proxyPort = $value;
}

public function setProxyLogin($value) {
$this->proxyLogin = $value;
}

public function setProxyPassword($value) {
$this->proxyPassword = $value;
}

public function setUserAgent($value) {
$this->userAgent = $value;
}

public function setCookies($value) {
$this->cookies = $value;
}

}
32 changes: 32 additions & 0 deletions hcaptchaproxyless.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

class HCaptchaProxyless extends Anticaptcha implements AntiCaptchaTaskProtocol {

private $websiteUrl;
private $websiteKey;

public function getPostData() {
return array(
"type" => "HCaptchaTaskProxyless",
"websiteURL" => $this->websiteUrl,
"websiteKey" => $this->websiteKey
);
}

public function setTaskInfo($taskInfo) {
$this->taskInfo = $taskInfo;
}

public function getTaskSolution() {
return $this->taskInfo->solution->gRecaptchaResponse;
}

public function setWebsiteURL($value) {
$this->websiteUrl = $value;
}

public function setWebsiteKey($value) {
$this->websiteKey = $value;
}

}
59 changes: 59 additions & 0 deletions squarecaptcha.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

class SquareCaptcha extends Anticaptcha implements AntiCaptchaTaskProtocol {

private $body;
private $objectName = "";
private $rowsCount = 3;
private $columnsCount = 3;


public function getPostData() {
return array(
"type" => "SquareNetTask",
"body" => str_replace("\n", "", $this->body),
"objectName" => $this->objectName,
"rowsCount" => $this->rowsCount,
"columnsCount" => $this->columnsCount
);
}

public function setTaskInfo($taskInfo) {
$this->taskInfo = $taskInfo;
}

public function getTaskSolution() {
return $this->taskInfo->solution->cellNumbers;
}

public function setFile($fileName) {

if (file_exists($fileName)) {

if (filesize($fileName) > 100) {
$this->body = base64_encode(file_get_contents($fileName));
return true;
} else {
$this->setErrorMessage("file $fileName too small or empty");
}

} else {
$this->setErrorMessage("file $fileName not found");
}
return false;

}

public function setObjectName($value) {
$this->objectName = $value;
}

public function setRowsCount($value) {
$this->rowsCount = $value;
}

public function setColumnsCount($value) {
$this->columnsCount = $value;
}

}

0 comments on commit f452cd5

Please sign in to comment.