diff --git a/apps/tools.js b/apps/tools.js index e033661..e74cb92 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -966,13 +966,14 @@ export class tools extends plugin { let id; if (msgUrl.includes("xhslink")) { await fetch(msgUrl, { + headers: XHS_NO_WATERMARK_HEADER, redirect: "follow", }).then(resp => { const uri = decodeURIComponent(resp.url); // 如果出现了网页验证uri:https://www.xiaohongshu.com/website-login/captcha?redirectPath=https://www.xiaohongshu.com/discovery/item/63c93ac3000000002203b28a?app_platform=android&app_version=8.23.1&author_share=1&ignoreEngage=true&share_from_user_hidden=true&type=normal&xhsshare=CopyLink&appuid=62c58b90000000000303dc54&apptime=1706149572&exSource=&verifyUuid=a5f32b62-453e-426b-98fe-2cfe0c16776d&verifyType=102&verifyBiz=461 const verify = uri.match(/\/item\/([0-9a-fA-F]+)/); // 一般情况下不会出现问题就使用这个正则 - id = /explore\/(\w+)/.exec(uri)?.[1] ?? verify?.[1]; + id = /noteId=(\w+)/.exec(uri)?.[1] ?? verify?.[1]; }); } else { id = /explore\/(\w+)/.exec(msgUrl)?.[1] || /discovery\/item\/(\w+)/.exec(msgUrl)?.[1]; diff --git a/utils/common.js b/utils/common.js index a42fccd..cadf7af 100644 --- a/utils/common.js +++ b/utils/common.js @@ -341,7 +341,7 @@ export async function testProxy(host='127.0.0.1', port=7890) { try { // 通过代理服务器发起请求 - await axios.get('https://google.com.hk', { httpsAgent }); + await axios.get('https://www.google.com', { httpsAgent }); logger.mark('[R插件][梯子测试模块] 检测到梯子'); return true; } catch (error) {