Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two captcha #14

Merged
merged 7 commits into from
Jun 10, 2024
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
3 changes: 2 additions & 1 deletion twocaptcha/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
![2Captcha logo](2captcha-logo.png){: width="50px"}
<img alt="2Captcha logo" src="2captcha-logo.png" height="64px" />

# 2captcha NodeJS captcha client - use 2captcha with ease
[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.com/paypalme/maxshydev)
[![GitHub stars](https://img.shields.io/github/stars/blackravenx/captcha-libs.svg?style=social&label=Star)](https://github.com/blackravenx/captcha-libs)
Expand Down
4 changes: 2 additions & 2 deletions twocaptcha/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions twocaptcha/package.json
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"
}
}
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Recognition/AudioTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class AudioTask extends BaseTask implements _IsTaskType, AudioTaskParams
/**
* @type {boolean} _isAudioTask - Only used for correct method overloading intellisense
*/
readonly _isAudioTask = true;
readonly _isAudioTask: _IsTaskType["_isAudioTask"] = true;

/**
* Create AudioTask
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Recognition/BoundingBoxTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class BoundingBoxTask extends BaseTask implements _IsTaskType, BoundingBo
/**
* @type {boolean} _isBoundingBoxTask - Only used for correct method overloading intellisense
*/
readonly _isBoundingBoxTask = true;
readonly _isBoundingBoxTask: _IsTaskType["_isBoundingBoxTask"] = true;

/**
* Create BoundingBoxTask
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Recognition/CoordinatesTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class CoordinatesTask extends BaseTask implements _IsTaskType, Coordinate
/**
* @type {boolean} _isCoordinatesTask - Only used for correct method overloading intellisense
*/
readonly _isCoordinatesTask = true;
readonly _isCoordinatesTask: _IsTaskType["_isCoordinatesTask"] = true;

/**
* Create CoordinatesTask
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Recognition/DrawAroundTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class DrawAroundTask extends BaseTask implements _IsTaskType, DrawAroundT
/**
* @type {boolean} _isDrawAroundTask - Only used for correct method overloading intellisense
*/
readonly _isDrawAroundTask = true;
readonly _isDrawAroundTask: _IsTaskType["_isDrawAroundTask"] = true;

/**
* Create DrawAroundTask
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Recognition/GridTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class GridTask extends BaseTask implements _IsTaskType, GridTaskParams {
/**
* @type {boolean} _isGridTask - Only used for correct method overloading intellisense
*/
readonly _isGridTask = true;
readonly _isGridTask: _IsTaskType["_isGridTask"] = true;

/**
* Create GridTask
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Recognition/ImageToTextTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class ImageToTextTask extends BaseTask implements _IsTaskType, ImageToTex
/**
* @type {boolean} _isImageToTextTask - Only used for correct method overloading intellisense
*/
readonly _isImageToTextTask = true;
readonly _isImageToTextTask: _IsTaskType["_isImageToTextTask"] = true;

/**
* Create ImageToTextTask
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Recognition/RotateTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class RotateTask extends BaseTask implements _IsTaskType, RotateTaskParam
/**
* @type {boolean} _isRotateTask - Only used for correct method overloading intellisense
*/
readonly _isRotateTask = true;
readonly _isRotateTask: _IsTaskType["_isRotateTask"] = true;

/**
* Create RotateTask
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Recognition/TextCaptchaTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class TextCaptchaTask extends BaseTask implements _IsTaskType, TextCaptch
/**
* @type {boolean} _isTextCaptchaTask - Only used for correct method overloading intellisense
*/
readonly _isTextCaptchaTask = true;
readonly _isTextCaptchaTask: _IsTaskType["_isTextCaptchaTask"] = true;

/**
* Create TextCaptchaTask
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Token/AmazonTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AmazonTask extends AmazonTaskBase implements _IsTaskType {
/**
* @type {boolean} _isAmazonTask - Only used for correct method overloading intellisense
*/
readonly _isAmazonTask = true;
readonly _isAmazonTask: _IsTaskType["_isAmazonTask"] = true;

/**
* Create AmazonTask
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Token/AmazonTaskProxyless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AmazonTaskProxyless extends AmazonTaskBase implements _IsTaskType {
/**
* @type {boolean} _isKeyCaptchaTask - Only used for correct method overloading intellisense
*/
readonly _isAmazonTaskProxyless = true;
readonly _isAmazonTaskProxyless: _IsTaskType["_isAmazonTaskProxyless"] = true;

/**
* Create AmazonTaskProxyless
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Token/AntiCyberSiAraTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AntiCyberSiAraTask extends AntiCyberSiAraTaskBase implements _IsTas
/**
* @type {boolean} _isAntiCyberSiAraTask - Only used for correct method overloading intellisense
*/
readonly _isAntiCyberSiAraTask = true;
readonly _isAntiCyberSiAraTask: _IsTaskType["_isAntiCyberSiAraTask"] = true;

/**
* Create AntiCyberSiAraTask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AntiCyberSiAraTaskProxyless extends AntiCyberSiAraTaskBase implemen
/**
* @type {boolean} _isAntiCyberSiAraTaskProxyless - Only used for correct method overloading intellisense
*/
readonly _isAntiCyberSiAraTaskProxyless = true;
readonly _isAntiCyberSiAraTaskProxyless: _IsTaskType["_isAntiCyberSiAraTaskProxyless"] = true;

/**
* Create AntiCyberSiAraTaskProxyless
Expand Down
37 changes: 37 additions & 0 deletions twocaptcha/src/lib/Requests/Token/AtbCaptchaTask.ts
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 twocaptcha/src/lib/Requests/Token/AtbCaptchaTaskProxyless.ts
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");
}
}
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Token/Base/_AmazonTaskBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export abstract class AmazonTaskBase extends BaseTask implements AmazonTaskBaseP
proxyType?: ProxyTypes;

/**
* Create AmazonTaskBase
* AmazonTaskBase
* {@link https://2captcha.com/api-docs/amazon-aws-waf-captcha}
* @param {Object} params - AmazonTaskParams
* @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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export abstract class AntiCyberSiAraTaskBase extends BaseTask implements AntiCyb
proxyType?: ProxyTypes;

/**
* Create AntiCyberSiAraTaskBase
* AntiCyberSiAraTaskBase
* {@link https://2captcha.com/api-docs/anti-cyber-siara}
* @param {Object} params - CapyTaskParams
* @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
Expand Down
67 changes: 67 additions & 0 deletions twocaptcha/src/lib/Requests/Token/Base/_AtbCaptchaTaskBase.ts
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;
}

}
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Token/Base/_CapyTaskBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export abstract class CapyTaskBase extends BaseTask implements CapyTaskBaseParam
proxyType?: ProxyTypes;

/**
* Create CapyTaskBase
* CapyTaskBase
* {@link https://2captcha.com/api-docs/capy-puzzle-captcha}
* @param {Object} params - CapyTaskParams
* @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
Expand Down
2 changes: 1 addition & 1 deletion twocaptcha/src/lib/Requests/Token/Base/_CutCaptchaTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export abstract class CutCaptchaTaskBase extends BaseTask implements CutCaptchaT
proxyType?: ProxyTypes;

/**
* Create CutCaptchaTaskBase
* CutCaptchaTaskBase
* {@link https://2captcha.com/api-docs/cutcaptcha}
* @param {Object} params - CutCaptchaTaskParams
* @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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export abstract class DataDomeSliderTaskBase extends BaseTask implements DataDom
proxyType: ProxyTypes;

/**
* Create DataDomeSliderTaskBase
* DataDomeSliderTaskBase
* {@link https://2captcha.com/api-docs/datadome-slider-captcha}
* @param {Object} params - DataDomeSliderTaskParams
* @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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export abstract class FriendlyCaptchaTaskBase extends BaseTask implements Friend
proxyType?: ProxyTypes;

/**
* Create FriendlyCaptchaTaskBase
* FriendlyCaptchaTaskBase
* {@link https://2captcha.com/api-docs/friendly-captcha}
* @param {Object} params - FriendlyCaptchaTaskParams
* @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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export abstract class FunCaptchaTaskBase extends BaseTask implements FunCaptchaT
proxyType?: ProxyTypes;

/**
* Create FunCaptchaTaskBase
* FunCaptchaTaskBase
* {@link https://2captcha.com/api-docs/arkoselabs-funcaptcha}
* @param {Object} params - FunCaptchaTaskBaseParams
* @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
Expand Down
Loading
Loading