🐞 fix: 修复 xhs 无法解析 && 微创重构 xhs 结构

This commit is contained in:
zhiyu1998 2024-10-30 23:59:31 +08:00
parent 032a3e177b
commit d6ed566f33

View File

@ -1377,7 +1377,7 @@ export class tools extends plugin {
const reg = /window\.__INITIAL_STATE__=(.*?)<\/script>/;
const res = xhsHtml.match(reg)[1].replace(/undefined/g, "null");
const resJson = JSON.parse(res);
saveJsonToFile(resJson);
// saveJsonToFile(resJson);
// 检测无效 Cookie
if (resJson?.note === undefined || resJson?.note?.noteDetailMap?.[id]?.note === undefined) {
e.reply(`检测到无效的小红书 Cookie可以尝试清除缓存和cookie 或者 换一个浏览器进行获取\n${ HELP_DOC }`);