DIYgod/RSSHub · error · ConfigNotFoundError

对应 uid 的 Bilibili 用户 请求失败

Error message

对应 uid 的 Bilibili 用户 请求失败

What it means

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.

Source

Thrown at lib/routes/bilibili/followings-dynamic.ts:83

    const name = await cache.getUsernameFromUID(uid);
    const cookie = config.bilibili.cookies[uid];
    if (cookie === undefined) {
        throw new ConfigNotFoundError('缺少对应 uid 的 Bilibili 用户登录后的 Cookie 值');
    }

    const response = await got({
        method: 'get',
        url: `https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=${uid}&type_list=268435455`,
        headers: {
            Referer: `https://space.bilibili.com/${uid}/`,
            Cookie: cookie,
        },
    });
    if (response.data.code === -6) {
        throw new ConfigNotFoundError('对应 uid 的 Bilibili 用户的 Cookie 已过期');
    }
    if (response.data.code === 4_100_000) {
        throw new ConfigNotFoundError('对应 uid 的 Bilibili 用户 请求失败');
    }
    const data = JSONbig.parse(response.body).data.cards;

    const getTitle = (data) => (data ? data.title || data.description || data.content || (data.vest && data.vest.content) || '' : '');
    const getDes = (data) =>
        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 || '';
    const getOriginDes = (data) => (data && (data.apiSeasonInfo && data.apiSeasonInfo.title && `//转发自: ${data.apiSeasonInfo.title}`) + (data.index_title && `<br>${data.index_title}`)) || '';
    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) || '';
    const getOriginTitle = (data) => (data.title ? `${data.title}<br>` : '');
    const getIframe = (data) => {
        if (!embed) {
            return '';
        }
        const aid = data?.aid;
        const bvid = data?.bvid;
        if (aid === undefined && bvid === undefined) {
            return '';
        }

View on GitHub (pinned to bed535e087)

Solutions

  1. Reduce the polling frequency for this route (increase ACCESS CONTROL / rate limit config).
  2. Run RSSHub behind a residential IP or proxy that Bilibili does not flag.
  3. Refresh the cookie from a clean browser session.
  4. Ensure config.trueUA is set so requests carry a realistic User-Agent.

Example fix

// before: aggressive polling from datacenter IP
// CACHE_EXPIRE defaults too low

// after: increase cache expiry in config
CACHE_EXPIRE=600
// and/or route through a residential proxy
Defensive patterns

Strategy: retry

Try / catch

try {
    const response = await got({...});
    if (response.data.code === 4_100_000) {
        // Risk control — back off and retry with delay
        logger.warn('Bilibili risk control triggered, backing off');
        throw new ConfigNotFoundError('Request failed (risk control)');
    }
} catch (e) {
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12). Data as JSON: /api/errors/482ec179a6fa3a9d. Report an issue: GitHub.