mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: 修复 xhs
短链接无法识别问题 & 梯子判断标准修正
This commit is contained in:
parent
d589898ffd
commit
82612e6e67
@ -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];
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user