-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
36 lines (33 loc) · 910 Bytes
/
test.js
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
const request = require("superagent").agent();
async function get_cookies() {
try {
const res = await request.get(
"https://akamapi-sv44j.ondigitalocean.app/os"
);
return res.body;
} catch (err) {
console.log(err);
throw new Error("Could not pass cookies from API!");
}
}
async function main() {
const cookies = await get_cookies();
const _abck = cookies["_abck"];
const bm_sz = cookies["bm_sz"];
await request
.get("https://www.offspring.co.uk/")
.set("cookie", `_abck=${_abck}; bm_sz=${bm_sz}`)
.set(
"user-agent",
"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; SCH-I535 Build/KOT49H) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"
)
.withCredentials()
.then((res) => {
console.log(res);
})
.catch((err) => {
console.log(err);
throw new Error("Didn't work!");
});
}
main();