-
Notifications
You must be signed in to change notification settings - Fork 0
/
tools.js
40 lines (40 loc) · 2.1 KB
/
tools.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
(function() {
var url = document.location.href; //"https://www.agefans.net/_getplay?aid={}&playindex=2&epindex=1&r={}";
var res = url.matchAll(/.*\/(.*)\?playid=(.*)_(.*)/g).next().value;
var aid = res[1];
var playindex = res[2];
var epindex = res[3];
var c_t1 = document.cookie.match(/t1=[^;]*/g)[0].split("=")[1];
var t1 = Math.round(Number(c_t1)/1000)>>5;
var k2 = (t1*(t1%4096)*0x3+83215)*(t1%4096)+t1;
var t2 = new Date().getTime();
fetch("https://www.agefans.net/_getplay?aid=" + aid + "&playindex=" + playindex + "&epindex=" + epindex + "&r=" + Math.random(), {
method: 'GET',
credentials: 'include',
headers: {
"Cookie": document.cookie + "; k2=" + k2 + "; t2=" + t2
}
}).then(function(res){return res.json()}).then(function(res){
var d = document.createElement('div');
var text = "";
for (var key in res){
if (key == "vurl") {
if (unescape(res[key]).indexOf("http") > -1) {
text += "<a style='background-color: red' href='" + unescape(res[key]) + "' target='_blank'>【跳转播放界面1】</a> ";
text += "<a style='background-color: red' href='" + res.purlf + unescape(res[key]) + "' target='_blank'>【跳转播放界面2】</a> ";
text += "<a style='background-color: red' href='" + res.purl + unescape(res[key]) + "' target='_blank'>【跳转播放界面3】</a> ";
text += "<br/>";
} else {
text += "<a style='background-color: red' href='" + res.purlf + unescape(res[key]) + "' target='_blank'>【跳转播放界面1】</a> ";
text += "<a style='background-color: red' href='" + res.purl + unescape(res[key]) + "' target='_blank'>【跳转播放界面2】</a> ";
text += "<br/>";
}
}
}
d.innerHTML = text;
d.style.width = "980px";
d.style.overflow = "auto";
var b = document.getElementById("playlist-div");
b.append(d);
});
})();