Skip to content

Commit 5efbcaf

Browse files
committed
fix get link
1 parent 41282df commit 5efbcaf

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/tiktok_snaptikApp.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ export default {
3636
}
3737

3838
function getLinkFromSomethingResult(somethingResult) {
39-
let jwttoken = /token=(.*)&/.exec(somethingResult)?.[1];
40-
let data = parseJwt(jwttoken);
41-
return data?.url;
39+
// let jwttoken = /token=(.*)&/.exec(somethingResult)?.[1];
40+
// let data = parseJwt(jwttoken);
41+
// return data?.url;
42+
let link = /down-right"><a href="(.*?)&dl=1"/.exec(somethingResult)?.[1];
43+
return link;
4244
}
4345

4446
async function getLinkSnapTik(tiktokURL, token, lang) {
@@ -54,8 +56,11 @@ export default {
5456

5557
let text = await res.text();
5658
let params = getParamsFromResponse(text);
59+
console.log(params)
5760
let somethingResult = doSomething2(...params);
61+
console.log(somethingResult)
5862
let link = getLinkFromSomethingResult(somethingResult);
63+
console.log(link)
5964
return link;
6065
}
6166

@@ -72,7 +77,7 @@ export default {
7277
let link = await getLinkSnapTik(tiktokUrl, token, lang);
7378
if (!link) throw Error("Không tìm thấy link");
7479

75-
window.open(link);
80+
// window.open(link);
7681
} catch (e) {
7782
prompt(
7883
"Lỗi: " + e + "\n\nBạn có thể mở trang web sau để thử lại:",

0 commit comments

Comments
 (0)