From cceedaafaaee472a1da59f3c847ee4f58ecfd772 Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Wed, 19 Jun 2024 09:10:01 +0400 Subject: [PATCH 1/5] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3a243bc..453abfe 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A wrapper around the [2captcha](https://2captcha.com/) API. This wrapper support Also added support for the `bounding_box` method. The Bounding Box Method allows you to mark data on the image. This method can be used to mark up datasets or highlight any objects in an image according to the given instructions. Read more about using *Bounding Box Method* on [documentation](https://2captcha.com/2captcha-api#bounding_box). -[2captcha](https://2captcha.com/) is a service that solves many different types of captchas, this library serves as a wrapper around API 2captcha to bring easy, promise-based functionality to NodeJS. This library specializes in concurrent solves, and bulk-api usage. +[2captcha](https://2captcha.com/) is a service that solves many different types of captchas, this library serves as a wrapper around API 2captcha to bring easy, promise-based functionality to Node.js. This library specializes in concurrent solves, and Bulk API usage. - [Install](#install) - [Configuration](#configuration) @@ -198,7 +198,7 @@ solver.geetestV4({ ### Yandex Smart Captcha -Use this method to solve Yandex and obtain a token to bypass the protection. +Use this method to solve Yandex Smart Captcha and obtain a token to bypass the protection. ```js solver.yandexSmart({ @@ -215,7 +215,7 @@ solver.yandexSmart({ ### Lemin captcha -Use this method to solve Lemin and obtain a token to bypass the protection. +Use this method to solve Lemin captcha and obtain a token to bypass the protection. ```js solver.lemin({ From de6391a1358706c29ec50cf2dc1c3171fb5030c1 Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Wed, 19 Jun 2024 09:11:42 +0400 Subject: [PATCH 2/5] typo --- jsdoc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsdoc.json b/jsdoc.json index 7fab1f5..51dd8c1 100644 --- a/jsdoc.json +++ b/jsdoc.json @@ -9,7 +9,7 @@ "opts": { "encoding": "utf8", "recurse": true, - "destionation": "./docs", + "destination": "./docs", "template": "./node_modules/jaguarjs-jsdoc" } } From e3ffa2ac9e18f02cd471e6a65d33dc36abcfefaa Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Wed, 19 Jun 2024 09:15:45 +0400 Subject: [PATCH 3/5] Delete non-updated files --- README.md | 3 - README.ru.md | 385 --------------------------------------------------- README.zh.md | 361 ----------------------------------------------- 3 files changed, 749 deletions(-) delete mode 100644 README.ru.md delete mode 100644 README.zh.md diff --git a/README.md b/README.md index 453abfe..2b5b5cd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -[English](README.md) (recommended) | [中国语文科](README.zh.md) | [Русский](README.ru.md) - - # JavaScript captcha solver module for 2Captcha API ## Description diff --git a/README.ru.md b/README.ru.md deleted file mode 100644 index 3a25d6e..0000000 --- a/README.ru.md +++ /dev/null @@ -1,385 +0,0 @@ -[English](README.md) | [中国语文科](README.zh.md) | [Русский](README.ru.md) - -# JavaScript модуль для 2Captcha API - -## Описание -Оболочка вокруг API сервиса [2captcha](https://2captcha.com/). Эта оболочка поддерживает решение следующих типов капч: reCAPTCHA V2, reCAPTCHA V3, hCaptcha, Arkose Labs FunCaptcha, image captcha, Coordinates (Click Captcha), Geetest, Geetest V4, Yandex Smart Captcha, Lemin captcha, Amazon WAF, Cloudflare Turnstile, Capy Puzzle, DataDome CAPTCHA, CyberSiARA, MTCaptcha, Friendly Captcha. - -Также добавлена поддержка метода `bounding_box`. Метод ограничивающей рамки позволяет размечать данные на изображении. Этот метод можно использовать для разметки наборов данных или выделения любых объектов на изображении в соответствии с заданными инструкциями. Подробнее об использовании *Bounding Box Method* читайте в [документации](https://2captcha.com/2captcha-api#bounding_box). - -[2captcha](https://2captcha.com/) это сервис, который решает множество различных типов капч. Эта библиотека служит оболочкой для API 2captcha, чтобы предоставить NodeJS простую функциональность, основанную на `promise`. - -## Поддерживаемые типы капч: -- ✅ google-recaptcha (reCAPTCHA v2 / reCAPTCHA v3) -- ✅ hCaptcha -- ✅ Arkose Labs FunCaptcha -- ✅ Image captchas. (`base64` format) -- ✅ Geetest -- ✅ Geetest v4 -- ✅ Yandex Smart Captcha -- ✅ Lemin Cropped Captcha -- ✅ Cloudflare Turnstile -- ✅ Amazon WAF Captcha -- ✅ Capy Puzzle -- ✅ Coordinates (Click Captcha) -- ⬜ Audio Recogntion -- ✅ DataDome CAPTCHA -- ✅ CyberSiARA -- ✅ MTCaptcha -- ✅ Friendly Captcha -- ✅ Bounding Box Method - - -## Установка - -```sh -npm install @2captcha/captcha-solver -``` -```sh -yarn add @2captcha/captcha-solver -``` - -## Примеры использования - - -### reCAPTCHA: -```js -const Captcha = require("@2captcha/captcha-solver") -// Новый экземпляр "solver" со значением вашего ключа 2captcha API -const solver = new Captcha.Solver("") - -// Решение reCAPTCHA, на демо странице содержащей reCAPTCHA V2 -solver.recaptcha({ - pageurl: 'https://2captcha.com/demo/recaptcha-v2', - googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u' -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### hCaptcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.hcaptcha({ - pageurl: "https://2captcha.com/demo/hcaptcha?difficulty=moderate", - sitekey: "b76cd927-d266-4cfb-a328-3b03ae07ded6" -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Arkose Labs FunCaptcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.funCaptcha({ - pageurl: "https://funcaptcha.com/tile-game-lite-mode/fc/api/nojs/?pkey=804380F4-6844-FFA1-ED4E-5877CA1F1EA4&lang=en", - publickey: "804380F4-6844-FFA1-ED4E-5877CA1F1EA4" -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Image captcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const fs = require("fs") -const solver = new Captcha.Solver("") - -// Получаем содержимое файла в формате base64 -const imageBase64 = fs.readFileSync("./tests/media/imageCaptcha_6e584.png", "base64") - -solver.imageCaptcha({ - body: imageBase64, - numeric: 4, - min_len: 5, - max_len: 5 -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - - -### GeeTest Captcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -// Значение `challenge` является динамическим -// Читайте подробнее о `challenge` на странице https://2captcha.com/p/geetest -solver.geetest({ - pageurl: 'https://2captcha.com/demo/geetest', - gt: '81388ea1fc187e0c335c0a8907ff2625', - challenge: '' -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### GeeTest V4 Captcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.geetestV4({ - pageurl: 'https://2captcha.com/demo/geetest-v4', - captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73' -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Yandex Smart Captcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.yandexSmart({ - pageurl: "https://captcha-api.yandex.ru/demo", - sitekey: "FEXfAbHQsToo97VidNVk3j4dC74nGW1DgdxjtNB9" - }) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Lemin captcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.lemin({ - pageurl:'https://dashboard.leminnow.com/auth/login', - captcha_id: 'CROPPED_099216d_34698cb7b8574265925f493cbcb3df4d', - div_id: 'lemin-cropped-captcha', - api_server: 'https://api.leminnow.com/captcha/v1/cropped' -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Cloudflare Turnstile: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.cloudflareTurnstile({ - pageurl: "https://app.nodecraft.com/login", - sitekey: "0x4AAAAAAAAkg0s3VIOD10y4" -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Amazon WAF Captcha (AWS WAF): -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -// INFO: Значение `context` является динамическим, необходимо каждый раз брать фактическое значение со страницы с капчей. -solver.amazonWaf({ - pageurl: "https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest", - sitekey: "AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AHMDLodoefdvyOnsHMRt...", - context: "9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ...", - iv: "CgAHbCe2GgAAAAAj", -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Capy Puzzle -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.capyPuzzle({ - pageurl: "https://www.capy.me/account/register/", - captchakey: "PUZZLE_Cme4hZLjuZRMYC3uh14C52D3uNms5w" -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### DataDome CAPTCHA -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - - -solver.dataDome({ - pageurl: "https://rendezvousparis.hermes.com/client/register", - captcha_url: "https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAEuQtkf4k1c0ABZhYZA%3D%3D&hash=789361B674144528D0B7EE76B35826&cid=mY4z7GNmh7Nt1lAFwpbNHAOcWPhyPgjHD2K1Pm~Od1iEKYLUnK3t7N2ZGUj8OqDK65cnwJHtHwd~t902vlwpSBA5l4ZHbS1Qszv~jEuEUJNQ_jMAjar2Kj3kq20MRJYh&t=fe&referer=https%3A%2F%2Frendezvousparis.hermes.com%2Fclient%2Fregister&s=40119&e=67fef144ac1a54dbd7507776367d2f9d5e36ec3add17fa22f3cb881db8385838", - userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36", - proxy: "login:password@1.2.3.4:8888", // The (Username : Password @ Address : Port) of our chosen proxy - proxytype: "http" // The 'Type' of proxy, http, https, socks, ect. -}) -.then((res) => { -console.log(res); -}) -.catch((err) => { -console.log(err); -}) -``` - -### CyberSiARA -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - - -solver.cyberSiARA({ - pageurl: "https://www.cybersiara.com/book-a-demo", - master_url_id: "OXR2LVNvCuXykkZbB8KZIfh162sNT8S2", - userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36" -}) -.then((res) => { -console.log(res); -}) -.catch((err) => { -console.log(err); -}) -``` - -### MTCaptcha -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - - -solver.mtCaptcha({ - pageurl: "https://service.mtcaptcha.com/mtcv1/demo/index.html", - sitekey: "MTPublic-DemoKey9M" -}) -.then((res) => { -console.log(res); -}) -.catch((err) => { -console.log(err); -}) -``` - -### Friendly Captcha - -Используйте этот метод, чтобы решить Friendly Captcha и получить токен для обхода защиты. - -> **Важно:**Для успешного использования полученного токена, на странице не должен быть загружен виджет капчи. Для этого вам нужно прервать запрос к `/friendcaptcha/...module.min.js` на странице. Когда виджет капчи уже загружен на страницу, велика вероятность, что полученный токен не сработает. - -```js -solver.friendlyCaptcha({ - pageurl: "https://geizhals.de/?liftban=1&from=/455973138?fsean=5901747021356", - sitekey: "FCMST5VUMCBOCGQ9" -}) -.then((res) => { -console.log(res); -}) -.catch((err) => { -console.log(err); -}) -``` - -### Coordinates (Click Captcha): -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") -const imageBase64 = fs.readFileSync("./tests/media/hCaptchaImage.jpg", "base64") - -solver.coordinates({ - body: imageBase64, - textinstructions: 'Select all photos containing the boat' - }) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Bounding Box Method: -*Bounding Box Method* позволяет выбирать объекты, указанные на изображении. Для этого вам необходимо передать инструкции по разметке. Инструкции могут быть отправлены в виде текста или изображения, закодированного в формате `base64`. Обязательно необходимо передать хотя бы одну инструкцию `imginstructions` или `textinstructions`. - -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.boundingBox({ - image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR4AAACwCAIAAAB...", - textinstructions: "Обведите все машины на изображении.", -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Proxy: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.recaptcha({ - pageurl: 'https://2captcha.com/demo/recaptcha-v2', - googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u', - proxy: "login:password@1.2.3.4:8888", // Параметры используемого вами прокси сервера - proxytype: "HTTP" // Тип используемого прокси: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`. -}) -.then((res) => { - console.log(res) -}) -.catch((err) => { - console.error(err.message) -}) -``` - -## Полезные статьи -* [Как решать капчу Geetest v4](https://2captcha.com/ru/blog/geetest-v4-obkhod) -* [Автоматическое решение reCAPTCHA V3 - инструкция для разработчиков и заказчиков](https://2captcha.com/ru/blog/avtomaticheskoe-reshenie-recaptcha-v3) -* Поиск значения `sitekey` для hCaptcha \ No newline at end of file diff --git a/README.zh.md b/README.zh.md deleted file mode 100644 index eae2637..0000000 --- a/README.zh.md +++ /dev/null @@ -1,361 +0,0 @@ -[English](README.md) | [中国语文科](README.zh.md) | [Русский](README.ru.md) - -# 2captcha API的JavaScript模块 - -## 资料描述 -提供[2captcha](https://2captcha.com/)服务的API的包装器. - 這個 npm 包包括對以下驗證碼類型的支持:reCAPTCHA V2, reCAPTCHA V3, hCaptcha, Arkose Labs FunCaptcha, image captcha, Coordinates (Click Captcha), Geetest, Geetest V4, Yandex Smart Captcha, Lemin captcha, Amazon WAF, Cloudflare Turnstile, Capy Puzzle, DataDome CAPTCHA, CyberSiARA, MTCaptcha. - -[2captcha](https://2captcha.com/)是一項服務,可讓您解決許多不同類型的驗證碼。這個 npm 包包裝了[2captcha](https://2captcha.com/)API 來為 NodeJS 提供簡單的基於`promise`的功能。 - -## 支持的驗證碼 -- ✅ google-recaptcha (reCAPTCHA v2 / reCAPTCHA v3) -- ✅ hCaptcha -- ✅ Arkose Labs FunCaptcha -- ✅ Image captchas. (`base64` format) -- ✅ Geetest -- ✅ Geetest v4 -- ✅ Yandex Smart Captcha -- ✅ Lemin Cropped Captcha -- ✅ Cloudflare Turnstile -- ✅ Amazon WAF Captcha -- ✅ Capy Puzzle -- ✅ Coordinates (Click Captcha) -- ⬜ Audio Recogntion -- ✅ DataDome CAPTCHA -- ✅ CyberSiARA -- ✅ MTCaptcha -- ✅ Bounding Box Method - -## 安装/安装 - -```sh -npm install @2captcha/captcha-solver -``` -```sh -yarn add @2captcha/captcha-solver -``` - -## 使用示例 - - -### reCAPTCHA: -```js -const Captcha = require("@2captcha/captcha-solver") -// 具有 2CAPTCHA API 密鑰值的新“求解器”實例。 -const solver = new Captcha.Solver("") - -// reCAPTCHA 解決方案,在包含 reCAPTCHA V2 的演示頁面上 -solver.recaptcha({ - pageurl: 'https://2captcha.com/demo/recaptcha-v2', - googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u' -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### hCaptcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.hcaptcha({ - pageurl: "https://2captcha.com/demo/hcaptcha?difficulty=moderate", - sitekey: "b76cd927-d266-4cfb-a328-3b03ae07ded6" -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Arkose Labs FunCaptcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.funCaptcha({ - pageurl: "https://funcaptcha.com/tile-game-lite-mode/fc/api/nojs/?pkey=804380F4-6844-FFA1-ED4E-5877CA1F1EA4&lang=en", - publickey: "804380F4-6844-FFA1-ED4E-5877CA1F1EA4" -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Image captcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const fs = require("fs") -const solver = new Captcha.Solver("") - -// 獲取base64格式的文件內容 -const imageBase64 = fs.readFileSync("./tests/media/imageCaptcha_6e584.png", "base64") - -solver.imageCaptcha({ - body: imageBase64, - numeric: 4, - min_len: 5, - max_len: 5 -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - - -### GeeTest Captcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -// `challenge` 值是動態的 -// 关于参数`challenge`的更多信息写在第https://2captcha.com/p/geetest页 -solver.geetest({ - pageurl: 'https://2captcha.com/demo/geetest', - gt: '81388ea1fc187e0c335c0a8907ff2625', - challenge: '' -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### GeeTest V4 Captcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.geetestV4({ - pageurl: 'https://2captcha.com/demo/geetest-v4', - captcha_id: 'e392e1d7fd421dc63325744d5a2b9c73' -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Yandex Smart Captcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.yandexSmart({ - pageurl: "https://captcha-api.yandex.ru/demo", - sitekey: "FEXfAbHQsToo97VidNVk3j4dC74nGW1DgdxjtNB9" - }) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Lemin captcha: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.lemin({ - pageurl:'https://dashboard.leminnow.com/auth/login', - captcha_id: 'CROPPED_099216d_34698cb7b8574265925f493cbcb3df4d', - div_id: 'lemin-cropped-captcha', - api_server: 'https://api.leminnow.com/captcha/v1/cropped' -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Cloudflare Turnstile: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.cloudflareTurnstile({ - pageurl: "https://app.nodecraft.com/login", - sitekey: "0x4AAAAAAAAkg0s3VIOD10y4" -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Amazon WAF Captcha (AWS WAF): -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -// INFO: 'Context'值是动态的,每次都需要从captcha页面获取新的`context`值。 -solver.amazonWaf({ - pageurl: "https://non-existent-example.execute-api.us-east-1.amazonaws.com/latest", - sitekey: "AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AHMDLodoefdvyOnsHMRt...", - context: "9BUgmlm48F92WUoqv97a49ZuEJJ50TCk9MVr3C7WMtQ0X6flVbufM4n8mjFLmbLVAPgaQ...", - iv: "CgAHbCe2GgAAAAAj", -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Capy Puzzle -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.capyPuzzle({ - pageurl: "https://www.capy.me/account/register/", - captchakey: "PUZZLE_Cme4hZLjuZRMYC3uh14C52D3uNms5w" -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### DataDome CAPTCHA -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - - -solver.dataDome({ - pageurl: "https://rendezvousparis.hermes.com/client/register", - captcha_url: "https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAEuQtkf4k1c0ABZhYZA%3D%3D&hash=789361B674144528D0B7EE76B35826&cid=mY4z7GNmh7Nt1lAFwpbNHAOcWPhyPgjHD2K1Pm~Od1iEKYLUnK3t7N2ZGUj8OqDK65cnwJHtHwd~t902vlwpSBA5l4ZHbS1Qszv~jEuEUJNQ_jMAjar2Kj3kq20MRJYh&t=fe&referer=https%3A%2F%2Frendezvousparis.hermes.com%2Fclient%2Fregister&s=40119&e=67fef144ac1a54dbd7507776367d2f9d5e36ec3add17fa22f3cb881db8385838", - userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36", - proxy: "login:password@1.2.3.4:8888", // The (Username : Password @ Address : Port) of our chosen proxy - proxytype: "http" // The 'Type' of proxy, http, https, socks, ect. -}) -.then((res) => { -console.log(res); -}) -.catch((err) => { -console.log(err); -}) -``` - -### CyberSiARA -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - - -solver.cyberSiARA({ - pageurl: "https://www.cybersiara.com/book-a-demo", - master_url_id: "OXR2LVNvCuXykkZbB8KZIfh162sNT8S2", - userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36" -}) -.then((res) => { -console.log(res); -}) -.catch((err) => { -console.log(err); -}) -``` - -### MTCaptcha -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - - -solver.mtCaptcha({ - pageurl: "https://service.mtcaptcha.com/mtcv1/demo/index.html", - sitekey: "MTPublic-DemoKey9M" -}) -.then((res) => { -console.log(res); -}) -.catch((err) => { -console.log(err); -}) -``` - -### Coordinates (Click Captcha): -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") -const imageBase64 = fs.readFileSync("./tests/media/hCaptchaImage.jpg", "base64") - -solver.coordinates({ - body: imageBase64, - textinstructions: 'Select all photos containing the boat' - }) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Bounding Box Method: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.boundingBox({ - image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR4AAACwCAIAAAB...", - textinstructions: "Circle all the cars in the image.", -}) -.then((res) => { - console.log(res); -}) -.catch((err) => { - console.log(err); -}) -``` - -### Proxy: -```js -const Captcha = require("@2captcha/captcha-solver") -const solver = new Captcha.Solver("") - -solver.recaptcha({ - pageurl: 'https://2captcha.com/demo/recaptcha-v2', - googlekey: '6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u', - proxy: "login:password@1.2.3.4:8888", // 您正在使用的代理服务器的参数 - proxytype: "HTTP" // 使用的代理服务器类型: `HTTP`, `HTTPS`, `SOCKS4`, `SOCKS5`. -}) -.then((res) => { - console.log(res) -}) -.catch((err) => { - console.error(err.message) -}) -``` - -## 有用的文章 -* [如何解决Geetest v4 captcha](https://2captcha.com/zh/blog/geetest-v4-support) -* [自动reCAPTCHA V3解决方案-开发人员和客户的说明](https://2captcha.com/zh/blog/recaptcha-v3-automatic-resolution) -* 搜索hCaptcha的`sitekey`值 \ No newline at end of file From e123baef13eda62048166189570e960f7d4301b8 Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Wed, 19 Jun 2024 09:35:44 +0400 Subject: [PATCH 4/5] typo --- src/structs/2captcha.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structs/2captcha.ts b/src/structs/2captcha.ts index d169c3e..ad98327 100644 --- a/src/structs/2captcha.ts +++ b/src/structs/2captcha.ts @@ -47,7 +47,7 @@ export interface paramsHCaptcha extends BaseSolve { } // FixMe:data[key] - how to send this parameter -export interface paramsFunCapthca extends BaseSolve { +export interface paramsFunCaptcha extends BaseSolve { publickey: string, pageurl: string, surl?: string, @@ -738,7 +738,7 @@ export class Solver { * console.log(err); * }) */ - public async funCaptcha(params: paramsFunCapthca): Promise { + public async funCaptcha(params: paramsFunCaptcha): Promise { checkCaptchaParams(params, "funcaptcha") const payload = { ...params, From 723c93cabd40ac7dc5cd0265bf8f3ae36054544a Mon Sep 17 00:00:00 2001 From: dzmitry-duboyski Date: Wed, 19 Jun 2024 09:57:19 +0400 Subject: [PATCH 5/5] refactor --- src/structs/2captcha.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/structs/2captcha.ts b/src/structs/2captcha.ts index ad98327..f95c5aa 100644 --- a/src/structs/2captcha.ts +++ b/src/structs/2captcha.ts @@ -8,11 +8,7 @@ import checkCaptchaParams from "../utils/checkCaptchaParams" const provider = getProviderData () -interface BaseSolve { - -} - -export interface paramsRecaptcha extends BaseSolve { +export interface paramsRecaptcha { pageurl: string, googlekey: string, invisible?: boolean, @@ -32,7 +28,7 @@ export interface paramsRecaptcha extends BaseSolve { } -export interface paramsHCaptcha extends BaseSolve { +export interface paramsHCaptcha { sitekey: string, pageurl: string, header_acao?: boolean, @@ -47,7 +43,7 @@ export interface paramsHCaptcha extends BaseSolve { } // FixMe:data[key] - how to send this parameter -export interface paramsFunCaptcha extends BaseSolve { +export interface paramsFunCaptcha { publickey: string, pageurl: string, surl?: string,