forked from dzmitry-duboyski/2captcha-ts
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathhunt.js
More file actions
32 lines (30 loc) · 914 Bytes
/
Copy pathhunt.js
File metadata and controls
32 lines (30 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const TwoCaptcha = require("../dist/index.js");
require('dotenv').config();
const APIKEY = process.env.APIKEY
const solver = new TwoCaptcha.Solver(APIKEY);
// Step 1: get X-HD
solver.hunt({
pageurl: "https://example.com/page-with-hunt",
apiGetLib: "https://example.com/hd-api/external/apps/app-id/api.js",
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"
})
.then((res) => {
console.log(res.data); // X-HD
})
.catch((err) => {
console.log(err);
})
// Step 2: solve captcha with meta.token
solver.hunt({
pageurl: "https://example.com/page-with-hunt",
apiGetLib: "https://example.com/hd-api/external/apps/app-id/api.js",
data: "META_TOKEN_VALUE",
proxy: "login:password@1.2.3.4:8080",
proxytype: "HTTP"
})
.then((res) => {
console.log(res.data); // solution token
})
.catch((err) => {
console.log(err);
})