{"record":{"id":"482ec179a6fa3a9d","repo":"DIYgod/RSSHub","slug":"uid-bilibili","errorCode":null,"errorMessage":"对应 uid 的 Bilibili 用户 请求失败","messagePattern":"对应 uid 的 Bilibili 用户 请求失败","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/bilibili/followings-dynamic.ts","lineNumber":83,"sourceCode":"    const name = await cache.getUsernameFromUID(uid);\n    const cookie = config.bilibili.cookies[uid];\n    if (cookie === undefined) {\n        throw new ConfigNotFoundError('缺少对应 uid 的 Bilibili 用户登录后的 Cookie 值');\n    }\n\n    const response = await got({\n        method: 'get',\n        url: `https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=${uid}&type_list=268435455`,\n        headers: {\n            Referer: `https://space.bilibili.com/${uid}/`,\n            Cookie: cookie,\n        },\n    });\n    if (response.data.code === -6) {\n        throw new ConfigNotFoundError('对应 uid 的 Bilibili 用户的 Cookie 已过期');\n    }\n    if (response.data.code === 4_100_000) {\n        throw new ConfigNotFoundError('对应 uid 的 Bilibili 用户 请求失败');\n    }\n    const data = JSONbig.parse(response.body).data.cards;\n\n    const getTitle = (data) => (data ? data.title || data.description || data.content || (data.vest && data.vest.content) || '' : '');\n    const getDes = (data) =>\n        data.dynamic || data.desc || data.description || data.content || data.summary || (data.vest && data.vest.content) + (data.sketch && `<br>${data.sketch.title}<br>${data.sketch.desc_text}`) || data.intro || '';\n    const getOriginDes = (data) => (data && (data.apiSeasonInfo && data.apiSeasonInfo.title && `//转发自: ${data.apiSeasonInfo.title}`) + (data.index_title && `<br>${data.index_title}`)) || '';\n    const getOriginName = (data) => data.uname || (data.author && data.author.name) || (data.upper && data.upper.name) || (data.user && (data.user.uname || data.user.name)) || (data.owner && data.owner.name) || '';\n    const getOriginTitle = (data) => (data.title ? `${data.title}<br>` : '');\n    const getIframe = (data) => {\n        if (!embed) {\n            return '';\n        }\n        const aid = data?.aid;\n        const bvid = data?.bvid;\n        if (aid === undefined && bvid === undefined) {\n            return '';\n        }","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/bilibili/followings-dynamic.ts#L65-L101","documentation":"ConfigNotFoundError thrown by the followings-dynamic route when Bilibili's dynamic_new API returns code 4100000. This code indicates the request was rejected by Bilibili (typically risk-control / anti-crawler triggering). The route treats this as a config-level error because it usually means the cookie or request fingerprint is flagged. It is thrown as ConfigNotFoundError though it is arguably not purely a config issue.","triggerScenarios":"The dynamic_svr API responds with code 4100000, which Bilibili uses for 'request failed' / risk-control rejections. This happens when the IP is rate-limited, the cookie is flagged for automation, or wbi/risk signatures are missing.","commonSituations":"RSSHub instance running on a cloud/datacenter IP that Bilibili flags; too-frequent polling triggering anti-crawler; cookie associated with suspicious activity; missing or stale browser-fingerprint headers.","solutions":["Reduce the polling frequency for this route (increase ACCESS CONTROL / rate limit config).","Run RSSHub behind a residential IP or proxy that Bilibili does not flag.","Refresh the cookie from a clean browser session.","Ensure config.trueUA is set so requests carry a realistic User-Agent."],"exampleFix":"// before: aggressive polling from datacenter IP\n// CACHE_EXPIRE defaults too low\n\n// after: increase cache expiry in config\nCACHE_EXPIRE=600\n// and/or route through a residential proxy","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    const response = await got({...});\n    if (response.data.code === 4_100_000) {\n        // Risk control — back off and retry with delay\n        logger.warn('Bilibili risk control triggered, backing off');\n        throw new ConfigNotFoundError('Request failed (risk control)');\n    }\n} catch (e) {\n    throw e;\n}","preventionTips":["Increase CACHE_EXPIRE to reduce request frequency.","Use a residential proxy if running from a datacenter IP.","Set config.trueUA for realistic request headers.","Stagger requests across different routes to avoid burst patterns."],"tags":["bilibili","rate-limiting","anti-crawler","risk-control","rsshub"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}