From c6e3717236e85ded6dffa909fdb2ece87f74f22b Mon Sep 17 00:00:00 2001 From: CaoMeiYouRen <996881204@qq.com> Date: Thu, 1 Feb 2024 18:21:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(route):=20=E4=BC=98=E5=8C=96=E5=BE=AE?= =?UTF-8?q?=E5=8D=9A=E5=8D=9A=E4=B8=BB=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/v2/weibo/user.js | 4 +++- website/docs/routes/social-media.mdx | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/v2/weibo/user.js b/lib/v2/weibo/user.js index b51cb84dfc87d7..2e4429b5cccc8f 100644 --- a/lib/v2/weibo/user.js +++ b/lib/v2/weibo/user.js @@ -21,7 +21,6 @@ module.exports = async (ctx) => { displayComments = fallback(undefined, queryToBoolean(routeParams.displayComments), false) ? '1' : '0'; } } - const containerData = await ctx.cache.tryGet( `weibo:user:index:${uid}`, async () => { @@ -32,6 +31,7 @@ module.exports = async (ctx) => { Referer: `https://m.weibo.cn/u/${uid}`, 'MWeibo-Pwa': 1, 'X-Requested-With': 'XMLHttpRequest', + Cookie: config.weibo.cookies, }, }); return _r.data; @@ -39,6 +39,7 @@ module.exports = async (ctx) => { config.cache.routeExpire, false ); + const name = containerData.data.userInfo.screen_name; const description = containerData.data.userInfo.description; const profileImageUrl = containerData.data.userInfo.profile_image_url; @@ -54,6 +55,7 @@ module.exports = async (ctx) => { Referer: `https://m.weibo.cn/u/${uid}`, 'MWeibo-Pwa': 1, 'X-Requested-With': 'XMLHttpRequest', + Cookie: config.weibo.cookies, }, }); return _r.data.data.cards; diff --git a/website/docs/routes/social-media.mdx b/website/docs/routes/social-media.mdx index ebdd6b6f33c0fb..342034c7298e5b 100644 --- a/website/docs/routes/social-media.mdx +++ b/website/docs/routes/social-media.mdx @@ -1479,8 +1479,14 @@ YouTube provides official RSS feeds for channels, for instance [https://www.yout ### 博主 {#wei-bo-bo-zhu} - - 部分博主仅登录可见,不支持订阅,可以通过打开 `https://m.weibo.cn/u/:uid` 验证 + + :::warning + 部分博主仅登录可见,未提供 Cookie 的情况下不支持订阅,可以通过打开 `https://m.weibo.cn/u/:uid` 验证。如需要订阅该部分博主,可配置 Cookie 后订阅。 + + 未提供 Cookie 的情况下偶尔会触发反爬限制,提供 Cookie 可缓解该情况。 + + 微博用户 Cookie 的配置可参照部署文档 + ::: ### 关键词 {#wei-bo-guan-jian-ci}