From 5cf74002bd852a7805fc20d6a339d40aaf7bf9e7 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 9 Sep 2024 22:53:10 +0800 Subject: [PATCH] fix(xiaohongshu): guid --- lib/routes/xiaohongshu/user.ts | 1 + lib/routes/xiaohongshu/util.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/routes/xiaohongshu/user.ts b/lib/routes/xiaohongshu/user.ts index b045dac67..6284f209b 100644 --- a/lib/routes/xiaohongshu/user.ts +++ b/lib/routes/xiaohongshu/user.ts @@ -51,6 +51,7 @@ async function handler(ctx) { n.map(({ id, noteCard }) => ({ title: noteCard.displayTitle, link: `${url}/${noteCard.noteId || id}`, + guid: noteCard.noteId || id || noteCard.cover?.infoList?.[0]?.url || noteCard.displayTitle, description: `
${noteCard.displayTitle}`, author: noteCard.user.nickname, upvotes: noteCard.interactInfo.likedCount, diff --git a/lib/routes/xiaohongshu/util.ts b/lib/routes/xiaohongshu/util.ts index 7e3cbd87f..7859ecf88 100644 --- a/lib/routes/xiaohongshu/util.ts +++ b/lib/routes/xiaohongshu/util.ts @@ -7,7 +7,9 @@ const getUser = (url, cache) => cache.tryGet( url, async () => { - const browser = await puppeteer(); + const browser = await puppeteer({ + stealth: true, + }); try { const page = await browser.newPage(); await page.setRequestInterception(true);