Socket
Socket
Sign inDemoInstall

2captcha

Package Overview
Dependencies
7
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.6 to 3.0.7

15

dist/structs/2captcha.d.ts

@@ -175,2 +175,17 @@ interface BaseSolve {

/**
* Solves a CloudFlare (turnstile) captcha
* @param publicKey The turnstile Site Key
* @param pageurl The URL to the website the captcha is seen on
* @param serviceURL The FunCaptcha Service URL (recommended)
* @param extra Extra properties to pass to 2captcha
*
* @returns {Promise<CaptchaAnswer>} The result from the solve
* @throws APIError
* turnstile("0x4AAAAAAADIkEVyoXXXXXXX", "http://mysite.com/page/with/turnstile/")
* .then((res) => {
* console.log(res)
* })
*/
turnstile(siteKey: string, pageURL: string, extra?: UserHCaptchaExtra): Promise<CaptchaAnswer>;
/**
* Reports a captcha as correctly solved.

@@ -177,0 +192,0 @@ *

@@ -320,2 +320,40 @@ "use strict";

/**
* Solves a CloudFlare (turnstile) captcha
* @param publicKey The turnstile Site Key
* @param pageurl The URL to the website the captcha is seen on
* @param serviceURL The FunCaptcha Service URL (recommended)
* @param extra Extra properties to pass to 2captcha
*
* @returns {Promise<CaptchaAnswer>} The result from the solve
* @throws APIError
* turnstile("0x4AAAAAAADIkEVyoXXXXXXX", "http://mysite.com/page/with/turnstile/")
* .then((res) => {
* console.log(res)
* })
*/
async turnstile(siteKey, pageURL, extra = {}) {
const payload = {
...extra,
...this.defaultPayload,
method: "turnstile",
sitekey: siteKey,
pageurl: pageURL,
};
const response = await (0, fetch_1.default)(this.in + utils.objectToURI(payload));
const result = await response.text();
let data;
try {
data = JSON.parse(result);
}
catch {
throw new _2captchaError_1.APIError(result);
}
if (data.status == 1) {
return this.pollResponse(data.request);
}
else {
throw new _2captchaError_1.APIError(data.request);
}
}
/**
* Reports a captcha as correctly solved.

@@ -322,0 +360,0 @@ *

2

package.json
{
"name": "2captcha",
"version": "3.0.6",
"version": "3.0.7",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "repository": "https://github.com/furry/2captcha",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc