From 2dc06134ae95ef349cc72391e2ce008f7d6a2360 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Fri, 12 Jul 2024 13:42:10 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=94=A8=E6=88=B7=E4=BD=BF=E7=94=A8=20TikTok?= =?UTF-8?q?=20=E8=A7=A3=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/tiktok.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/tiktok.js b/utils/tiktok.js index 63b55c9..fa0ac09 100644 --- a/utils/tiktok.js +++ b/utils/tiktok.js @@ -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); };