From 5fc16d937fa9d92be659ce4652e89e75409a0207 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Thu, 31 Oct 2024 10:49:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8D=20xhs?= =?UTF-8?q?=20=E5=9C=A8=20pc=20=E7=AB=AF=E6=97=A0=E6=B3=95=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/tools.js b/apps/tools.js index c987b5f..4c6f04b 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1356,7 +1356,8 @@ export class tools extends plugin { xsecToken = parsedUrl.searchParams.get("xsec_token"); }); } else { - const parsedUrl = new URL(msgUrl); + // 新版 xhs 这里必须是e.msg.trim(),因为要匹配参数:xsec_source 和 xsec_token + const parsedUrl = new URL(e.msg.trim()); id = /explore\/(\w+)/.exec(msgUrl)?.[1] || /discovery\/item\/(\w+)/.exec(msgUrl)?.[1]; // 提取 xsec_source 和 xsec_token 参数 xsecSource = parsedUrl.searchParams.get("xsec_source") ?? "pc_feed";