{"record":{"id":"9491b059ce53ea0f","repo":"DIYgod/RSSHub","slug":"loginuid-bilibili-cookie","errorCode":null,"errorMessage":"对应 loginUid 的 Bilibili 用户的 Cookie 已过期","messagePattern":"对应 loginUid 的 Bilibili 用户的 Cookie 已过期","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/bilibili/followers.ts","lineNumber":73,"sourceCode":"    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}/`,\n            Cookie: cookie,\n        },\n    });\n    if (response.data.code === -6 || response.data.code === -101) {\n        throw new ConfigNotFoundError('对应 loginUid 的 Bilibili 用户的 Cookie 已过期');\n    }\n    const data = response.data.data.list;\n\n    return {\n        title: `${name} 的 bilibili 粉丝`,\n        link: `https://space.bilibili.com/${uid}/#/fans/fans`,\n        description: `${name} 的 bilibili 粉丝`,\n        item: data.map((item) => ({\n            title: `${name} 新粉丝 ${item.uname}`,\n            description: `${item.uname}<br>${item.sign}<br>总计${count}`,\n            pubDate: new Date(item.mtime * 1000),\n            link: `https://space.bilibili.com/${item.mid}`,\n        })),\n    };\n}\n","sourceCodeStart":55,"sourceCodeEnd":89,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/bilibili/followers.ts#L55-L89","documentation":"ConfigNotFoundError thrown by the bilibili followers route when the followers API returns code -6 (not logged in) or -101 (credentials invalid). Since a cookie was present (else error 78 would have fired), these codes mean the cookie for loginUid has expired or been revoked.","triggerScenarios":"config.bilibili.cookies[loginUid] is set, the followers request is sent with it, and bilibili responds with code -6 or -101.","commonSituations":"Cookie expired (bilibili sessions age out); user logged out / revoked sessions; SESSDATA was truncated when copied.","solutions":["Re-log into bilibili.com, copy a fresh SESSDATA (and bili_jct) for the loginUid account, update config.bilibili.cookies[loginUid], and restart RSSHub.","If it reoccurs quickly, check whether the account is being challenged (verify the cookie still works in a browser)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (response.data.code === -6 || response.data.code === -101) {\n    throw new ConfigNotFoundError('Cookie for loginUid has expired; please refresh.');\n}","typeGuard":"function isExpiredCookieCode(code: number): boolean {\n    return code === -6 || code === -101;\n}","tryCatchPattern":"try {\n    if (response.data.code === -6 || response.data.code === -101) {\n        throw new ConfigNotFoundError('Cookie expired');\n    }\n} catch (e) {\n    if (e instanceof ConfigNotFoundError) {\n        // operator must refresh config.bilibili.cookies[loginUid]\n    }\n    throw e;\n}","preventionTips":["Refresh bilibili cookies on a schedule before SESSDATA expires.","Treat -6/-101 as operator-actionable and alert so the cookie gets renewed."],"tags":["bilibili","cookie","authentication","expired","config-not-found","i18n"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}