🎈 pref: 提升 xhs 在 pc 端解析健壮性

This commit is contained in:
zhiyu1998 2024-10-31 12:23:31 +08:00
parent 7b26f44f68
commit 4b6a4a38ea

View File

@ -1357,7 +1357,7 @@ export class tools extends plugin {
}); });
} else { } else {
// 新版 xhs 这里必须是e.msg.trim()因为要匹配参数xsec_source 和 xsec_token // 新版 xhs 这里必须是e.msg.trim()因为要匹配参数xsec_source 和 xsec_token
const xhsUrlMatch = e.msg.trim().match(/(http|https)?:\/\/(www\.)?xiaohongshu\.com[^\s]+/); const xhsUrlMatch = e.msg.trim().replace("amp;", "").match(/(http|https)?:\/\/(www\.)?xiaohongshu\.com[^\s]+/);
if (!xhsUrlMatch) { if (!xhsUrlMatch) {
logger.info("[R插件][xhs] 无法匹配到链接"); logger.info("[R插件][xhs] 无法匹配到链接");
return; return;