{"record":{"id":"d8544b452096512f","repo":"DIYgod/RSSHub","slug":"sehuatang-rss-is-disabled-due-to-the-lack-of-a-hr","errorCode":null,"errorMessage":"Sehuatang RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>","messagePattern":"Sehuatang RSS is disabled due to the lack of <a href=\"https://docs\\.rsshub\\.app/deploy/config#route-specific-configurations\">relevant config</a>","errorType":"error_code","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/sehuatang/user.ts","lineNumber":39,"sourceCode":"                name: 'SEHUATANG_COOKIE',\n                description: '',\n            },\n        ],\n        requirePuppeteer: false,\n        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n        nsfw: true,\n    },\n    name: '作者文章',\n    maintainers: ['JamYiz'],\n    handler,\n};\n\nasync function handler(ctx) {\n    if (!config.sehuatang.cookie) {\n        throw new ConfigNotFoundError('Sehuatang RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>');\n    }\n    // 从Url参数中获取uid\n    const uid = ctx.req.param('uid');\n    const link = `${baseUrl}home.php?mod=space&uid=${uid}&do=thread&view=me&from=space`;\n\n    const response = await got(link, {\n        headers: {\n            Cookie: config.sehuatang.cookie,\n            'Accept-Encoding': 'gzip, deflate, br',\n            'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',\n        },\n    });\n\n    const $ = load(response.data);\n\n    const list = $('#delform tr:not(.th)')\n        .slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25)\n        .toArray()","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/sehuatang/user.ts#L21-L57","documentation":"The Sehuatang user-articles route requires a logged-in session cookie (`config.sehuatang.cookie`) because the forum gates member thread listings behind authentication. Without it, the handler refuses to run — any unauthenticated request to the forum returns a login redirect, not the thread list. The check fires before `got(link, {headers: {Cookie: ...}})`.","triggerScenarios":"Thrown at lib/routes/sehuatang/user.ts:39 when the library encounters an invalid state.","commonSituations":"Self-hosted deploy without the cookie set; user expects the public rsshub.app to provide authenticated content; cookie expired (Sehuatang sessions rotate) and was removed but not refreshed.","solutions":["Log in to Sehuatang in a browser, copy the full `Cookie` header value, and set `SEHUATANG_COOKIE=<value>` in the RSSHub environment, then restart.","Refresh the cookie periodically — forum sessions expire and the route will start returning empty or login-redirect content once it does.","If you cannot obtain an account, this route is unavailable to you."],"exampleFix":"// before\n# SEHUATANG_COOKIE unset\n\n// after\nSEHUATANG_COOKIE=PHPSESSID=xxxxxxx; xxxxx=yyyyy","handlingStrategy":"validation","validationCode":"if (!config.sehuatang?.cookie) {\n    return ctx.body('Sehuatang route requires SEHUATANG_COOKIE.', 503);\n}","typeGuard":"const hasSehuatangCookie = (c: typeof config): boolean => Boolean(c.sehuatang?.cookie);","tryCatchPattern":null,"preventionTips":["Refresh the cookie on a schedule — forum sessions expire.","Store the cookie in a secret manager, not the repo.","Monitor for login-redirect responses that indicate an expired cookie."],"tags":["config-missing","auth-cookie","nsfw"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}