mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: 修复部分用户使用 TikTok 解析问题
This commit is contained in:
parent
9a545f66a9
commit
2dc06134ae
@ -1,4 +1,4 @@
|
||||
import HttpProxyAgent from "https-proxy-agent";
|
||||
import { HttpsProxyAgent } from 'https-proxy-agent';
|
||||
|
||||
/**
|
||||
* Tiktok专属解析链接的Fetch
|
||||
@ -7,7 +7,6 @@ import HttpProxyAgent from "https-proxy-agent";
|
||||
* @param proxy 梯子
|
||||
*/
|
||||
const fetchTiktokUrl = async (url, isOversea, proxy) => {
|
||||
const proxyAgent = isOversea ? '' : new HttpProxyAgent(proxy);
|
||||
// 处理特殊情况 & 非特殊情况的header
|
||||
const headers = url.includes("vm.tiktok") || url.includes("tiktok.com/t")
|
||||
? { "User-Agent": "facebookexternalhit/1.1" }
|
||||
@ -18,7 +17,7 @@ const fetchTiktokUrl = async (url, isOversea, proxy) => {
|
||||
redirect: "follow",
|
||||
follow: 10,
|
||||
timeout: 10000,
|
||||
agent: proxyAgent,
|
||||
agent: isOversea ? undefined : new HttpsProxyAgent(proxy),
|
||||
}).then(resp => resp.url);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user