{"record":{"id":"fc819fe4054f5f44","repo":"DIYgod/RSSHub","slug":"tsdm39-cookie-a-href-https-docs-rs","errorCode":null,"errorMessage":"缺少 TSDM39 用户登录后的 Cookie 值 <a href=\"https://docs.rsshub.app/zh/deploy/config#route-specific-configurations\">TSDM 相关路由</a>","messagePattern":"缺少 TSDM39 用户登录后的 Cookie 值 <a href=\"https://docs\\.rsshub\\.app/zh/deploy/config#route-specific-configurations\">TSDM 相关路由</a>","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/tsdm39/bd.ts","lineNumber":40,"sourceCode":"    const heading: string[] = [],\n        separator: string[] = [],\n        body: string[] = [];\n\n    for (const key in mapping) {\n        heading.push(mapping[key]);\n        separator.push(':--:');\n        body.push(key);\n    }\n\n    return [heading.join(' | '), separator.join(' | '), body.join(' | ')].map((s) => `| ${s} |`).join('\\n');\n};\n\nconst handler: Route['handler'] = async (ctx) => {\n    const { type } = ctx.req.param();\n\n    const cookie = config.tsdm39.cookie;\n    if (!cookie) {\n        throw new ConfigNotFoundError('缺少 TSDM39 用户登录后的 Cookie 值 <a href=\"https://docs.rsshub.app/zh/deploy/config#route-specific-configurations\">TSDM 相关路由</a>');\n    }\n\n    const html = await ofetch(`https://www.tsdm39.com/forum.php?mod=forumdisplay&fid=85${type ? `&filter=typeid&typeid=${type}` : ''}`, {\n        headers: {\n            Cookie: cookie,\n        },\n    });\n\n    const $ = load(html);\n\n    const item = $('tbody.tsdm_normalthread')\n        .toArray()\n        .map<DataItem>((item) => {\n            const $ = load(item);\n\n            const title = $('a.xst').text();\n            const price = $('span.xw1').last().text();\n            const link = $('a.xst').attr('href');","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/tsdm39/bd.ts#L22-L58","documentation":"ConfigNotFoundError thrown by the TSDM39 forum route because `config.tsdm39.cookie` is unset. The route needs an authenticated session cookie to access the forum display page, so without it the handler aborts before any request.","triggerScenarios":"Deploying RSSHub without setting `TSDM39_COOKIE` (or the env var it maps from) — `config.tsdm39.cookie` is falsy on line 42 and line 43 throws. The message links to the route-specific config docs.","commonSituations":"Self-hosted RSSHub where the operator skipped TSDM-specific env vars; the cookie expired and the operator removed it; .env not loaded in the deployment.","solutions":["Log in to https://www.tsdm39.com in a browser, copy the full Cookie header, and set it as `TSDM39_COOKIE` (or the documented env var) in your RSSHub config.","Restart the RSSHub process so config is reloaded.","If the cookie no longer works (forum changed), re-login and rotate it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!config.tsdm39?.cookie) { throw new ConfigNotFoundError('Set TSDM39_COOKIE before enabling this route'); }","typeGuard":"const hasCookie = (c: unknown): c is string => typeof c === 'string' && c.trim().length > 0;","tryCatchPattern":null,"preventionTips":["Document the cookie env var prominently","Rotate the cookie on a schedule — forum sessions expire","Validate config at boot and log which routes are disabled"],"tags":["config","cookie","authentication","tsdm39","config-not-found"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}