mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
✨ feat: 添加tiktok新短号支持
This commit is contained in:
parent
c1a1a65507
commit
97684297d7
@ -33,7 +33,7 @@ export class tools extends plugin {
|
|||||||
fnc: "douyin",
|
fnc: "douyin",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
reg: "(.*)(www.tiktok.com)|(vt.tiktok.com)",
|
reg: "(.*)(www.tiktok.com)|(vt.tiktok.com)|(vm.tiktok.com)",
|
||||||
fnc: "tiktok",
|
fnc: "tiktok",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -171,6 +171,7 @@ export class tools extends plugin {
|
|||||||
async tiktok (e) {
|
async tiktok (e) {
|
||||||
const urlRex = /(http:|https:)\/\/www.tiktok.com\/[A-Za-z\d._?%&+\-=\/#@]*/g;
|
const urlRex = /(http:|https:)\/\/www.tiktok.com\/[A-Za-z\d._?%&+\-=\/#@]*/g;
|
||||||
const urlShortRex = /(http:|https:)\/\/vt.tiktok.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
const urlShortRex = /(http:|https:)\/\/vt.tiktok.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
||||||
|
const urlShortRex2 = /(http:|https:)\/\/vm.tiktok.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
||||||
let url = e.msg.trim();
|
let url = e.msg.trim();
|
||||||
// 短号处理
|
// 短号处理
|
||||||
if (url.includes("vt.tiktok")) {
|
if (url.includes("vt.tiktok")) {
|
||||||
@ -183,6 +184,17 @@ export class tools extends plugin {
|
|||||||
}).then(resp => {
|
}).then(resp => {
|
||||||
url = resp.url;
|
url = resp.url;
|
||||||
});
|
});
|
||||||
|
} else if (url.includes("vm.tiktok")) {
|
||||||
|
const temp_url = urlShortRex2.exec(url)[0];
|
||||||
|
await fetch(temp_url, {
|
||||||
|
headers: { "User-Agent": "facebookexternalhit/1.1" },
|
||||||
|
redirect: "follow",
|
||||||
|
follow: 10,
|
||||||
|
timeout: 10000,
|
||||||
|
agent: new HttpProxyAgent(this.myProxy),
|
||||||
|
}).then(resp => {
|
||||||
|
url = resp.url;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
url = urlRex.exec(url)[0];
|
url = urlRex.exec(url)[0];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user