{"record":{"id":"9a78f5f31ce1f61e","repo":"DIYgod/RSSHub","slug":"weibo-user-bookmarks-is-not-available-due-to-the-a","errorCode":null,"errorMessage":"Weibo user bookmarks is not available due to the absense of [Weibo Cookies]. Check <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config tutorial</a>","messagePattern":"Weibo user bookmarks is not available due to the absense of \\[Weibo Cookies\\]\\. Check <a href=\"https://docs\\.rsshub\\.app/deploy/config#route-specific-configurations\">relevant config tutorial</a>","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/routes/weibo/user-bookmarks.ts","lineNumber":54,"sourceCode":"            target: '/user_bookmarks/:uid',\n        },\n    ],\n    name: '用户收藏动态',\n    maintainers: ['cztchoice'],\n    handler,\n    url: 'weibo.com/',\n    description: `::: warning\n此方案必须使用用户\\`Cookie\\`进行抓取，只可以获取本人的收藏动态\n\n因微博 cookies 的过期与更新方案未经验证，部署一次 Cookie 的有效时长未知\n\n微博用户 Cookie 的配置可参照部署文档\n:::`,\n};\n\nasync function handler(ctx) {\n    if (!config.weibo.cookies) {\n        throw new ConfigNotFoundError('Weibo user bookmarks is not available due to the absense of [Weibo Cookies]. Check <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config tutorial</a>');\n    }\n\n    let displayVideo = '1';\n    let displayArticle = '0';\n    let displayComments = '0';\n    if (ctx.req.param('routeParams')) {\n        if (ctx.req.param('routeParams') === '1' || ctx.req.param('routeParams') === '0') {\n            displayVideo = ctx.req.param('routeParams');\n        } else {\n            const routeParams = querystring.parse(ctx.req.param('routeParams'));\n            displayVideo = fallback(undefined, queryToBoolean(routeParams.displayVideo), true) ? '1' : '0';\n            displayArticle = fallback(undefined, queryToBoolean(routeParams.displayArticle), false) ? '1' : '0';\n            displayComments = fallback(undefined, queryToBoolean(routeParams.displayComments), false) ? '1' : '0';\n        }\n    }\n\n    const uid = await cache.tryGet(\n        'weibo:user_bookmarks:login-user',","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/weibo/user-bookmarks.ts#L36-L72","documentation":"Thrown by the Weibo user bookmarks route when `config.weibo.cookies` is not set. This route fetches the authenticated user's bookmarked (collected) posts via the private container API (`https://m.weibo.cn/api/container/getIndex`). Since bookmarks are private, only the cookie owner's own bookmarks are accessible. This is a `ConfigNotFoundError`.","triggerScenarios":"A request to `/weibo/user_bookmarks/:uid/:routeParams?` on an instance without `WEIBO_COOKIES`. The guard fires at line 53 before any API call. Note: even with cookies, the route can only fetch the bookmarks of the logged-in cookie owner, not arbitrary users.","commonSituations":"The `WEIBO_COOKIES` environment variable is unset; the cookie has expired (Weibo cookies have limited validity); or the user is on a public instance that doesn't support private routes.","solutions":["Set `WEIBO_COOKIES` to a valid cookie string from a logged-in Weibo browser session.","Ensure the `uid` path parameter matches the cookie owner's own UID — you can only fetch your own bookmarks.","Follow the configuration tutorial in the error message link for cookie setup.","If cookies expire, re-extract and redeploy them."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure WEIBO_COOKIES is set AND the uid matches the cookie owner\nif (!process.env.WEIBO_COOKIES) {\n    throw new Error('WEIBO_COOKIES required for /weibo/user_bookmarks');\n}\n// The uid must be the cookie owner's own UID — bookmarks are private","typeGuard":null,"tryCatchPattern":"try {\n    const feed = await fetchRss('/weibo/user_bookmarks/' + uid);\n} catch (e) {\n    if (e.name === 'ConfigNotFoundError') {\n        console.error('WEIBO_COOKIES not set. This route fetches private bookmarks.');\n    }\n    throw e;\n}","preventionTips":["Set WEIBO_COOKIES with a valid cookie from the account whose bookmarks you want.","The uid parameter must match the cookie owner — you cannot fetch another user's bookmarks.","Re-extract cookies when they expire; bookmark routes are especially sensitive to stale sessions.","Self-host RSSHub for this route; never rely on public instances for private data."],"tags":["config-error","config-not-found","authentication","weibo","cookies","rss-route","private-data"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}