{"record":{"id":"ae876a31e4a07775","repo":"DIYgod/RSSHub","slug":"loginuid-bilibili-cookie-a-href","errorCode":null,"errorMessage":"缺少对应 loginUid 的 Bilibili 用户登录后的 Cookie 值 <a href=\"https://docs.rsshub.app/zh/deploy/config#route-specific-configurations\">bilibili 用户关注动态系列路由</a>","messagePattern":"缺少对应 loginUid 的 Bilibili 用户登录后的 Cookie 值 <a href=\"https://docs\\.rsshub\\.app/zh/deploy/config#route-specific-configurations\">bilibili 用户关注动态系列路由</a>","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/bilibili/followers.ts","lineNumber":50,"sourceCode":"            source: ['space.bilibili.com/:uid'],\n            target: '/user/followers/:uid',\n        },\n    ],\n    name: 'UP 主粉丝',\n    maintainers: ['Qixingchen'],\n    handler,\n    description: `::: warning\nUP 主粉丝现在需要 b 站登录后的 Cookie 值，所以只能自建，详情见部署页面的配置模块。\n:::`,\n};\n\nasync function handler(ctx) {\n    const uid = ctx.req.param('uid');\n    const loginUid = ctx.req.param('loginUid');\n\n    const cookie = config.bilibili.cookies[loginUid];\n    if (cookie === undefined) {\n        throw new ConfigNotFoundError('缺少对应 loginUid 的 Bilibili 用户登录后的 Cookie 值 <a href=\"https://docs.rsshub.app/zh/deploy/config#route-specific-configurations\">bilibili 用户关注动态系列路由</a>');\n    }\n\n    const name = await cache.getUsernameFromUID(uid);\n\n    const countResponse = await got({\n        method: 'get',\n        url: `https://api.bilibili.com/x/relation/stat?vmid=${uid}`,\n        headers: {\n            Referer: `https://space.bilibili.com/${uid}/`,\n        },\n    });\n    const count = countResponse.data.data.follower;\n\n    const response = await got({\n        method: 'get',\n        url: `https://api.bilibili.com/x/relation/followers?vmid=${uid}`,\n        headers: {\n            Referer: `https://space.bilibili.com/${uid}/`,","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/bilibili/followers.ts#L32-L68","documentation":"ConfigNotFoundError thrown by the bilibili followers route when config.bilibili.cookies[loginUid] is undefined. The followers API needs a logged-in user's cookie to list who follows a given uid, so a missing cookie for the supplied loginUid makes the route unusable and points the operator at the deploy docs.","triggerScenarios":"Calling /bilibili/followers/:uid/:loginUid where loginUid has no entry in config.bilibili.cookies (e.g. cookies only configured for a different account).","commonSituations":"Self-hosted instance configured one bilibili cookie but the request names a different loginUid; cookie map key typo; env var not loaded.","solutions":["Add a cookie entry for the loginUid account under config.bilibili.cookies (see https://docs.rsshub.app/deploy/config) — copy SESSDATA/BUSS from a logged-in bilibili.com session.","Restart RSSHub and re-request with that loginUid."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const cookie = config.bilibili.cookies[loginUid];\nif (cookie === undefined) {\n    throw new ConfigNotFoundError(`Missing bilibili cookie for loginUid ${loginUid}.`);\n}","typeGuard":"function hasLoginCookie(loginUid: string): boolean {\n    return config.bilibili.cookies[loginUid] !== undefined;\n}","tryCatchPattern":null,"preventionTips":["Configure one cookie entry per account you intend to use as loginUid.","Boot-time validate that referenced loginUids have cookies."],"tags":["bilibili","config","cookie","authentication","config-not-found","i18n"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}