-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from blackravenx/TwoCaptcha
Two captcha
- Loading branch information
Showing
104 changed files
with
695 additions
and
114 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,34 +1,34 @@ | ||
{ | ||
"name": "@captcha-libs/twocaptcha", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"keywords": [ | ||
"TwoCaptcha", | ||
"Captcha recognition", | ||
"Captcha solving", | ||
"ReCaptcha captcha", | ||
"DataDome captcha", | ||
"HCaptcha captcha", | ||
"GeeTest captcha", | ||
"FriendlyCaptcha", | ||
"FunCaptcha", | ||
"KeyCaptcha", | ||
"CutCaptcha", | ||
"CapyCaptcha", | ||
"AntiCyberSiAra captcha", | ||
"MtCaptcha", | ||
"AWS WAF captcha", | ||
"Cloudflare captcha" | ||
"TwoCaptcha", | ||
"Captcha recognition", | ||
"Captcha solving", | ||
"ReCaptcha captcha", | ||
"DataDome captcha", | ||
"HCaptcha captcha", | ||
"GeeTest captcha", | ||
"FriendlyCaptcha", | ||
"FunCaptcha", | ||
"KeyCaptcha", | ||
"CutCaptcha", | ||
"CapyCaptcha", | ||
"AntiCyberSiAra captcha", | ||
"MtCaptcha", | ||
"AWS WAF captcha", | ||
"Cloudflare captcha" | ||
], | ||
"license": "ISC", | ||
"author": "Max Shy", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/blackravenx/captcha-libs.git", | ||
"directory": "twocaptcha" | ||
"type": "git", | ||
"url": "https://github.com/blackravenx/captcha-libs.git", | ||
"directory": "twocaptcha" | ||
}, | ||
"dependencies": { | ||
"@captcha-libs/captcha-client": "latest", | ||
"ofetch": "^1.3.3" | ||
}, | ||
}, | ||
"description": "TwoCaptcha NodeJS client, captcha recognition service" | ||
} | ||
} |
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
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,37 @@ | ||
import type { | ||
ProxyRequiredTaskParams, _IsTaskType | ||
} from "../_BaseTaskRequest"; | ||
import type { AtbCaptchaTaskBaseParams } from "./Base/_AtbCaptchaTaskBase"; | ||
import { AtbCaptchaTaskBase } from "./Base/_AtbCaptchaTaskBase"; | ||
|
||
type AtbCaptchaTaskParams = ProxyRequiredTaskParams<AtbCaptchaTaskBaseParams>; | ||
|
||
/** | ||
* Token-based method to bypass Tencent captcha. | ||
* @extends {AtbCaptchaTaskBase} | ||
* {@link https://2captcha.com/api-docs/atb-captcha} | ||
*/ | ||
export class AtbCaptchaTask extends AtbCaptchaTaskBase implements _IsTaskType { | ||
|
||
/** | ||
* @type {boolean} _isAtbCaptchaTask - Only used for correct method overloading intellisense | ||
*/ | ||
readonly _isAtbCaptchaTask: _IsTaskType["_isAtbCaptchaTask"] = true; | ||
|
||
/** | ||
* Create AtbCaptchaTask | ||
* {@link https://2captcha.com/api-docs/atb-captcha} | ||
* @param {Object} params - AtbCaptchaTaskParams | ||
* @param {string} [params.websiteURL] - The full URL of target web page where the captcha is loaded. We do not open the page, not a problem if it is available only for authenticated users | ||
* @param {string} [params.appId] - The value of appId parameter in the website source code. | ||
* @param {string} [params.apiServer] - The value of apiServer parameter in the website source code. | ||
* @param {string} [params.proxyAddress] - Proxy IP address or hostname | ||
* @param {string} [params.proxyLogin] - Login for basic authentication on the proxy | ||
* @param {string} [params.proxyPassword] - Password for basic authentication on the proxy | ||
* @param {string} [params.proxyType] - Type of your proxy: HTTP, HTTPS, SOCKS4, SOCKS5 | ||
* @param {string} [params.proxyPort] - Proxy port | ||
*/ | ||
constructor(params: AtbCaptchaTaskParams) { | ||
super(params, "AtbCaptchaTask"); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
twocaptcha/src/lib/Requests/Token/AtbCaptchaTaskProxyless.ts
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,32 @@ | ||
import type { | ||
ProxylessTaskParams, _IsTaskType | ||
} from "../_BaseTaskRequest"; | ||
import type { AtbCaptchaTaskBaseParams } from "./Base/_AtbCaptchaTaskBase"; | ||
import { AtbCaptchaTaskBase } from "./Base/_AtbCaptchaTaskBase"; | ||
|
||
type AtbCaptchaTaskProxylessParams = ProxylessTaskParams<AtbCaptchaTaskBaseParams>; | ||
|
||
/** | ||
* Token-based method to bypass Tencent captcha. | ||
* @extends {AtbCaptchaTaskProxylessBase} | ||
* {@link https://2captcha.com/api-docs/atb-captcha} | ||
*/ | ||
export class AtbCaptchaTaskProxyless extends AtbCaptchaTaskBase implements _IsTaskType { | ||
|
||
/** | ||
* @type {boolean} _isAtbCaptchaTaskProxyless - Only used for correct method overloading intellisense | ||
*/ | ||
readonly _isAtbCaptchaTaskProxyless: _IsTaskType["_isAtbCaptchaTaskProxyless"] = true; | ||
|
||
/** | ||
* Create AtbCaptchaTaskProxyless | ||
* {@link https://2captcha.com/api-docs/atb-captcha} | ||
* @param {Object} params - AtbCaptchaTaskProxylessParams | ||
* @param {string} [params.websiteURL] - The full URL of target web page where the captcha is loaded. We do not open the page, not a problem if it is available only for authenticated users | ||
* @param {string} [params.appId] - The value of appId parameter in the website source code. | ||
* @param {string} [params.apiServer] - The value of apiServer parameter in the website source code. | ||
*/ | ||
constructor(params: AtbCaptchaTaskProxylessParams) { | ||
super(params, "AtbCaptchaTaskProxyless"); | ||
} | ||
} |
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
67 changes: 67 additions & 0 deletions
67
twocaptcha/src/lib/Requests/Token/Base/_AtbCaptchaTaskBase.ts
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,67 @@ | ||
import type { | ||
ProxyCredentials, ProxyTypes, TaskTypes | ||
} from "../../_BaseTaskRequest"; | ||
import { BaseTask } from "../../_BaseTaskRequest"; | ||
|
||
export type AtbCaptchaTaskBaseParams = Partial<ProxyCredentials> & { | ||
apiServer: string; | ||
appId: string; | ||
websiteURL: string; | ||
}; | ||
|
||
/** | ||
* Base class for AtbCaptchaTask | ||
* @extends {BaseTask} | ||
* {@link https://2captcha.com/api-docs/atb-captcha} | ||
*/ | ||
export abstract class AtbCaptchaTaskBase extends BaseTask implements AtbCaptchaTaskBaseParams { | ||
|
||
/** | ||
* @type {string} websiteURL - The full URL of target web page where the captcha is loaded. We do not open the page, not a problem if it is available only for authenticated users | ||
*/ | ||
websiteURL: string; | ||
|
||
/** | ||
* @type {string} appId - The value of appId parameter in the website source code. | ||
*/ | ||
appId: string; | ||
|
||
/** | ||
* @type {string} apiServer - The value of apiServer parameter in the website source code. | ||
*/ | ||
apiServer: string; | ||
proxyAddress?: string; | ||
proxyLogin?: string; | ||
proxyPassword?: string; | ||
proxyPort?: number; | ||
proxyType?: ProxyTypes; | ||
proxy?: string; | ||
|
||
/** | ||
* AtbCaptchaTaskBase | ||
* {@link https://2captcha.com/api-docs/atb-captcha} | ||
* @param {Object} params - AtbCaptchaTaskParams | ||
* @param {string} [params.websiteURL] - The full URL of target web page where the captcha is loaded. We do not open the page, not a problem if it is available only for authenticated users | ||
* @param {string} [params.appId] - The value of appId parameter in the website source code. | ||
* @param {string} [params.apiServer] - The value of apiServer parameter in the website source code. | ||
* @param {string} [params.proxyAddress] - Proxy IP address or hostname | ||
* @param {string} [params.proxyLogin] - Login for basic authentication on the proxy | ||
* @param {string} [params.proxyPassword] - Password for basic authentication on the proxy | ||
* @param {string} [params.proxyType] - Type of your proxy: HTTP, HTTPS, SOCKS4, SOCKS5 | ||
* @param {string} [params.proxyPort] - Proxy port | ||
*/ | ||
constructor({ | ||
appId, websiteURL, proxyAddress, proxyPort, proxyType, proxyLogin, proxyPassword, apiServer | ||
}: AtbCaptchaTaskBaseParams, type: TaskTypes) { | ||
super({ type }); | ||
this.appId = appId; | ||
this.websiteURL = websiteURL; | ||
this.proxyAddress = proxyAddress; | ||
this.proxyLogin = proxyLogin; | ||
this.proxyPassword = proxyPassword; | ||
this.proxyPort = proxyPort; | ||
this.proxyType = proxyType; | ||
this.apiServer = apiServer; | ||
} | ||
|
||
} |
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
Oops, something went wrong.