Skip to content

Commit df1eb93

Browse files
committed
fix getlink luanxt
1 parent 7a31389 commit df1eb93

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

scripts/getLinkLuanxt.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,23 @@ export default {
1212
whiteList: [],
1313
runInExtensionContext: true,
1414

15-
func: function () {
15+
func: async function () {
1616
// https://luanxt.com/get-link-mp3-320-lossless-vip-zing/
1717

18+
async function getLuanxtUserToken() {
19+
try {
20+
let res = await fetch(apiBaseURL);
21+
let text = await res.text();
22+
return /let userToken = "(.*)";/.exec(text)?.[1];
23+
} catch (e) {
24+
alert("ERROR: " + e);
25+
return null;
26+
}
27+
}
28+
1829
const apiBaseURL = "https://luanxt.com/get-link-mp3-320-lossless-vip-zing/";
19-
const userToken = "2e8878cfbdf8cec26ac6e041c0d90979f65c01c4";
30+
const userToken = await getLuanxtUserToken();
31+
2032
// let xtSalt = "(k[1>>8]>>>k%2=0).fromCharCode";
2133
// xtSalt =
2234
// "undefined" == typeof jQuery ||
@@ -217,4 +229,4 @@ function backup() {
217229
http://htlove.org/mod-320kb
218230
http://mp3.lisvn.net/
219231
*/
220-
}
232+
}

0 commit comments

Comments
 (0)