This repository was archived by the owner on Mar 20, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ts
More file actions
45 lines (33 loc) · 1.33 KB
/
test.ts
File metadata and controls
45 lines (33 loc) · 1.33 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
'use strict'
import { sleep } from "bun"
import { fetchHtml } from "./src/utils/download"
async function resolvePaheInk(link: string) {
const linkurl = new URL(link);
let body = await fetchHtml(linkurl);
console.log(body.toString());
let formData = new URLSearchParams();
formData.append('hw', body.querySelector('form > input[name="hq"]')!.getAttribute('value')!);
body = await fetchHtml(linkurl.origin, {
body: formData,
"method": "POST",
})
let sleepTime = 30
while (body.querySelector('form') != undefined) {
console.log(body.toString());
await sleep(1000*sleepTime);
const form = body.querySelector('form')!;
formData = new URLSearchParams();
formData.append('hw', form.querySelector('input[name="hq"]')!.getAttribute('value')!);
body = await fetchHtml(form.getAttribute('action')!, {
body: formData,
"method": "POST",
})
sleepTime += 5;
}
console.log(body.toString());
link = body.querySelector('a')?.getAttribute('href')!;
console.log(link);
body = await fetchHtml(link);
let value = body.querySelector('form > input[name="token"]')?.getAttribute('value');
}
resolvePaheInk('https://teknoasian.com/?ht=m0vHLGr%2FURxdB8KPFpApfwAMrRKoQ4xkQpgh%2BOdS0CNi3gw45xA1v1WDeZNNUAH3SlBHOEhxSFRlRk9xZXZZeFJ4U1gzcWcycXRjKzcwSUNxWHE2ZFpZZjMySWlLY3JtcDNIa0xXRjZiZ3hKYlNwTA%3D%3D');