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}