{"record":{"id":"64be043c7edd89b6","repo":"DIYgod/RSSHub","slug":"error-64be04","errorCode":null,"errorMessage":"遇到源站风控校验，请稍后再试","messagePattern":"遇到源站风控校验，请稍后再试","errorType":"exception","errorClass":"CaptchaError","httpStatus":503,"severity":"error","filePath":"lib/routes/bilibili/dynamic.ts","lineNumber":299,"sourceCode":"                Cookie: cookie,\n            },\n        });\n        const body = JSONbig.parse(response.body);\n        return body;\n    };\n\n    let body: BilibiliWebDynamicResponse;\n\n    const cookie = (await cacheIn.getCookie()) as string;\n    body = await getDynamic(cookie);\n\n    if (body?.code === -352) {\n        const cookie = (await cacheIn.getCookie(true)) as string;\n        body = await getDynamic(cookie);\n\n        if (body?.code === -352) {\n            cache.set('bili-cookie', '');\n            throw new CaptchaError('遇到源站风控校验，请稍后再试');\n        }\n    }\n    const items = (body as BilibiliWebDynamicResponse)?.data?.items;\n\n    let author = items[0]?.modules?.module_author?.name;\n    let face = items[0]?.modules?.module_author?.face;\n    if (!face || !author) {\n        const usernameAndFace = await cacheIn.getUsernameAndFaceFromUID(uid);\n        author = usernameAndFace[0] || items[0]?.modules?.module_author?.name;\n        face = usernameAndFace[1] || items[0]?.modules?.module_author?.face;\n    } else {\n        cache.set(`bili-username-from-uid-${uid}`, author);\n        cache.set(`bili-userface-from-uid-${uid}`, face);\n    }\n\n    const rssItems = await Promise.all(\n        items\n            .filter((item) => {","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/bilibili/dynamic.ts#L281-L317","documentation":"CaptchaError thrown by the bilibili dynamic route after the dynamic API returns code -352 twice in a row: once with the cached cookie and once with a freshly fetched cookie. Code -352 is bilibili's risk-control challenge, so after the second failure the route invalidates the stored bili-cookie and surfaces a Chinese 'source risk-control verification, try again later' message.","triggerScenarios":"Both getDynamic calls (cached cookie, then refreshed cookie) return code -352; the route clears the shared 'bili-cookie' cache entry and throws CaptchaError.","commonSituations":"Bilibili is actively challenging the instance's IP/cookie; the bili-cookie pool is exhausted or all cookies are flagged; running from a datacenter IP that bilibili rate-limits.","solutions":["Wait and retry — the cached cookie is cleared, so the next request will fetch a fresh one.","Supply a logged-in bilibili cookie (config.bilibili.cookies) so the dynamic API is not challenged as an anonymous client.","If recurring, run RSSHub from a cleaner/residential egress or add more cookies to the pool."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (body?.code === -352) {\n    // will retry once with a fresh cookie before throwing\n}","typeGuard":"function isRiskControl(body: any): boolean {\n    return body?.code === -352;\n}","tryCatchPattern":"try {\n    body = await getDynamic(cookie);\n} catch (e) {\n    if (e instanceof CaptchaError) {\n        // back off and retry later; do not hammer the API\n    }\n    throw e;\n}","preventionTips":["Keep a pool of valid bilibili cookies to reduce -352 frequency.","Treat CaptchaError as non-retryable for a cooldown period to avoid amplifying risk control."],"tags":["bilibili","risk-control","captcha","cookie","retry","anti-bot","i18n"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}