{"record":{"id":"3b53abdff2ca44d4","repo":"DIYgod/RSSHub","slug":"loginuid-bilibili-cookie-3b53ab","errorCode":null,"errorMessage":"对应 loginUid 的 Bilibili 用户的 Cookie 已过期","messagePattern":"对应 loginUid 的 Bilibili 用户的 Cookie 已过期","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/bilibili/followings.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.following;\n\n    const response = await got({\n        method: 'get',\n        url: `https://api.bilibili.com/x/relation/followings?vmid=${uid}`,\n        headers: {\n            Referer: `https://space.bilibili.com/${uid}/`,\n            Cookie: cookie,\n        },\n    });\n    if (response.data.code === -6) {\n        throw new ConfigNotFoundError('对应 loginUid 的 Bilibili 用户的 Cookie 已过期');\n    }\n    // 22115 : 用户已设置隐私，无法查看\n    if (response.data.code === 22115) {\n        throw new InvalidParameterError(response.data.message);\n    }\n    const data = response.data.data.list;\n\n    return {\n        title: `${name} 的 bilibili 关注`,\n        link: `https://space.bilibili.com/${uid}/#/fans/follow`,\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    };","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/bilibili/followings.ts#L55-L91","documentation":"ConfigNotFoundError thrown by the followings route when Bilibili's /x/relation/followings API returns code -6, indicating the loginUid's cookie (SESSDATA) has expired. The authenticated request to fetch a user's following list is rejected because the session is invalid.","triggerScenarios":"The relation/followings endpoint returns code -6 for the loginUid cookie. Occurs after SESSDATA expiry, account password change, or Bilibili session invalidation.","commonSituations":"Cookie set long ago and expired naturally; password changed on the loginUid account; cookie string truncated; Bilibili security rotation.","solutions":["Re-login to bilibili.com with the loginUid account and copy a fresh Cookie.","Update BILIBILI_COOKIE_<loginUid> and restart RSSHub.","Verify SESSDATA is included in the cookie value."],"exampleFix":"// before: expired loginUid cookie\nBILIBILI_COOKIE_111111=SESSDATA=old;...\n\n// after\nBILIBILI_COOKIE_111111=SESSDATA=fresh; bili_jct=xxx; DedeUserID=111111;","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    const response = await got({...});\n    if (response.data.code === -6) {\n        throw new ConfigNotFoundError('loginUid cookie expired');\n    }\n} catch (e) {\n    throw e;\n}","preventionTips":["Refresh the loginUid cookie periodically.","Monitor for -6 codes across all bilibili routes.","Document cookie refresh procedures."],"tags":["bilibili","cookie","session-expiry","authentication","rsshub"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}