{"record":{"id":"0bc242b6f272229e","repo":"DIYgod/RSSHub","slug":"baidu-tieba-rss-is-disabled-due-to-the-lack-of-a","errorCode":null,"errorMessage":"Baidu Tieba RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#baidu\">BAIDU_COOKIE</a>","messagePattern":"Baidu Tieba RSS is disabled due to the lack of <a href=\"https://docs\\.rsshub\\.app/deploy/config#baidu\">BAIDU_COOKIE</a>","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/baidu/tieba/common.ts","lineNumber":54,"sourceCode":"\n/**\n * 使用 Playwright 获取贴吧页面内容\n * 包含统一的 cookie 设置、安全验证检查和缓存逻辑\n * 带有重试机制处理瞬态错误\n */\nexport async function getTiebaPageContent(\n    url: string,\n    cacheKey: string,\n    options: {\n        waitForSelector?: string;\n        timeout?: number;\n        retries?: number;\n    } = {}\n): Promise<string> {\n    const cookie = config.baidu.cookie;\n\n    if (!cookie) {\n        throw new ConfigNotFoundError('Baidu Tieba RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#baidu\">BAIDU_COOKIE</a>');\n    }\n\n    const cookies = parseBaiduCookies(cookie);\n    const { waitForSelector = '.thread-card-wrapper, .virtual-list-item, .thread-content-box, .thread-card', timeout = 3000, retries = 3 } = options;\n\n    const data = await cache.tryGet(\n        cacheKey,\n        async () => {\n            let lastError: Error | undefined;\n\n            /* eslint-disable no-await-in-loop -- Intentional sequential retry logic */\n            for (let attempt = 0; attempt < retries; attempt++) {\n                const { page, destroy } = await getPlaywrightPage(url, {\n                    onBeforeLoad: async (page) => {\n                        if (cookies.length > 0) {\n                            await page.context().addCookies(cookies);\n                        }\n                    },","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/baidu/tieba/common.ts#L36-L72","documentation":"ConfigNotFoundError thrown by getTiebaPageContent when config.baidu.cookie is falsy. The Playwright-based Tieba fetcher cannot operate without BAIDU_COOKIE because every page load needs authenticated cookies to pass Baidu's security verification, so the route refuses to run and points the operator at the deploy docs.","triggerScenarios":"Any Tieba route that calls getTiebaPageContent while BAIDU_COOKIE is unset/empty in the RSSHub config.","commonSituations":"Self-hosted RSSHub deployed without BAIDU_COOKIE; env var name typo; cookie value cleared during a config rotation.","solutions":["Set BAIDU_COOKIE in your RSSHub config (see https://docs.rsshub.app/deploy/config#baidu) to a cookie string copied from a logged-in tieba.baidu.com session, including BDUSS.","Restart RSSHub after setting the env var so config is re-read.","Verify with a smoke-test request to the Tieba route once the cookie is in place."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!config.baidu.cookie) {\n    throw new ConfigNotFoundError('BAIDU_COOKIE is not set. Configure it per https://docs.rsshub.app/deploy/config#baidu');\n}","typeGuard":"function hasBaiduCookie(c: typeof config): boolean {\n    return Boolean(c.baidu?.cookie);\n}","tryCatchPattern":null,"preventionTips":["Set BAIDU_COOKIE at deploy time and validate it on boot.","Treat ConfigNotFoundError as an operator-actionable signal — surface it to ops, not end users."],"tags":["baidu","tieba","config","cookie","config-not-found"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}