-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathvpnoe.js
84 lines (80 loc) · 2.62 KB
/
vpnoe.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
const { wf } = require("./utils");
async function genCookie() {
const res = await fetch(
"https://vpnoe.com/mfjd.html/comment?time=" + Date.now(),
{
headers: {
accept: "text/plain, */*; q=0.01",
"accept-language": "zh-CN,zh;q=0.9,ga;q=0.8",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
priority: "u=1, i",
"sec-ch-ua":
'"Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"',
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": '"macOS"',
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-requested-with": "XMLHttpRequest",
Referer: "https://vpnoe.com/mfjd.html",
"Referrer-Policy": "strict-origin-when-cross-origin",
"User-Agent":
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
},
body:
"author=luqwe&mail=luqwe%40qq.com&text=thanks&url=&_=" +
(function () {
var _Y1LG = "88aq7dabddc859Nw554e0088d7e52e446663",
_WHVREa = [
[2, 4],
[12, 14],
];
for (var i = 0; i < _WHVREa.length; i++) {
_Y1LG =
_Y1LG.substring(0, _WHVREa[i][0]) +
_Y1LG.substring(_WHVREa[i][1]);
}
return _Y1LG;
})(),
method: "POST",
mode: "cors",
redirect: "manual",
}
);
const ck = res.headers.get("set-cookie");
if (ck) {
const rt = ck.match(/([a-z0-9]+)__typecho_remember_author/);
const [_, token] = rt;
const author = token + "__typecho_remember_author=luqwe";
const mail = token + "__typecho_remember_mail=luqwe%40qq.com";
return `${author} ;${mail};`;
} else {
return `579e449d7eec66b888e62c8140a39ba6__typecho_remember_author=iiitre; 579e449d7eec66b888e62c8140a39ba6__typecho_remember_mail=gawe%40gmail.com`;
}
}
(async () => {
await fetch("https://vpnoe.com/mfjd.html", {
headers: {
Cookie: await genCookie(),
},
}).then(async (res) => {
const text = await res.text();
if (res.status === 200) {
let [_, link] = text.match(
'\\<code class="lang-java">https://(.*)\\<\\/code'
);
console.log("link:", "https://" + link);
await fetch(
`https://api.subcsub.com/sub?target=clash&url=${encodeURIComponent(
"https://" + link
)}&insert=false`
)
.then((r) => r.text())
.then((text) => {
if (text) {
wf("vpnoe.yaml", text);
}
});
}
});
})();