-
Notifications
You must be signed in to change notification settings - Fork 283
Expand file tree
/
Copy pathszy.jsd
More file actions
56 lines (53 loc) · 1.6 KB
/
szy.jsd
File metadata and controls
56 lines (53 loc) · 1.6 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
45
46
47
48
49
50
51
52
53
54
55
56
// http://localhost:5757/parse/szy?url=https://v.qq.com/x/cover/mzc00200vkqr54u/v4100qp69zl.html
const {getHtml} = $.require('./_lib.request.js');
const host = 'https://ppl.sszzyy.com';
const jx = {
header: {
'User-Agent': PC_UA,
'Referer': host,
'origin': host,
},
};
async function lazy(input, params) {
console.log('input:', input);
// 生成时间戳和密钥
const t = Math.floor(Date.now() / 1000);
const key = md5(`123456789${input}${t}`);
console.log('key:', key);
// 准备请求数据
// const postData = `url=${encodeURIComponent(input)}&time=${t}&key=${key}`;
const postData = qs.stringify({
'url': encodeURIComponent(input),
'time': t,
'key': key
});
console.log('postData:', postData);
let reqs = (await getHtml({
url: "https://ppl.sszzyy.com",
method: 'POST',
headers: jx.header,
data: postData,
})).data;
console.log(reqs);
// 解密 URL
const SECRET_KEY = 'ARTPLAYER2023217';
const IV = 'Artplayerapiban1';
let play_url = reqs.url;
return {
url: decrypt(play_url, SECRET_KEY, IV),
header: {
'origin': host,
'User-Agent': jx.header['User-Agent'],
}
}
}
function decrypt(text, aes_key, aes_iv) {
let key = CryptoJS.enc.Utf8.parse(aes_key),
iv = CryptoJS.enc.Utf8.parse(aes_iv),
decrypted = CryptoJS.AES.decrypt(text, key, {
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return decrypted.toString(CryptoJS.enc.Utf8);
}