DIYgod/RSSHub · error · ConfigNotFoundError
Weibo user bookmarks is not available due to the absense of
Error message
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>
What it means
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`.
Source
Thrown at lib/routes/weibo/user-bookmarks.ts:54
target: '/user_bookmarks/:uid',
},
],
name: '用户收藏动态',
maintainers: ['cztchoice'],
handler,
url: 'weibo.com/',
description: `::: warning
此方案必须使用用户\`Cookie\`进行抓取,只可以获取本人的收藏动态
因微博 cookies 的过期与更新方案未经验证,部署一次 Cookie 的有效时长未知
微博用户 Cookie 的配置可参照部署文档
:::`,
};
async function handler(ctx) {
if (!config.weibo.cookies) {
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>');
}
let displayVideo = '1';
let displayArticle = '0';
let displayComments = '0';
if (ctx.req.param('routeParams')) {
if (ctx.req.param('routeParams') === '1' || ctx.req.param('routeParams') === '0') {
displayVideo = ctx.req.param('routeParams');
} else {
const routeParams = querystring.parse(ctx.req.param('routeParams'));
displayVideo = fallback(undefined, queryToBoolean(routeParams.displayVideo), true) ? '1' : '0';
displayArticle = fallback(undefined, queryToBoolean(routeParams.displayArticle), false) ? '1' : '0';
displayComments = fallback(undefined, queryToBoolean(routeParams.displayComments), false) ? '1' : '0';
}
}
const uid = await cache.tryGet(
'weibo:user_bookmarks:login-user',View on GitHub (pinned to bed535e087)
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.
Defensive patterns
Strategy: validation
Validate before calling
// Ensure WEIBO_COOKIES is set AND the uid matches the cookie owner
if (!process.env.WEIBO_COOKIES) {
throw new Error('WEIBO_COOKIES required for /weibo/user_bookmarks');
}
// The uid must be the cookie owner's own UID — bookmarks are private Try / catch
try {
const feed = await fetchRss('/weibo/user_bookmarks/' + uid);
} catch (e) {
if (e.name === 'ConfigNotFoundError') {
console.error('WEIBO_COOKIES not set. This route fetches private bookmarks.');
}
throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Weibo Friends Timeline is not available due to the absense o
- Weibo Group Timeline is not available due to the absense of
- Cookies expired. Please update WEIBO_COOKIES
- Cookies expired. Msg: ${resp?.data?.msg || ''} ${resp?.data?
- 缺少对应 loginUid 的 Bilibili 用户登录后的 Cookie 值 <a href="https://do
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/9a78f5f31ce1f61e.
Report an issue: GitHub.