{"record":{"id":"f5e6ef6aa69ea46f","repo":"DIYgod/RSSHub","slug":"is-disabled-due-to-the-lack-of-smzdm-cook-f5e6ef","errorCode":null,"errorMessage":"什么值得买排行榜 is disabled due to the lack of SMZDM_COOKIE","messagePattern":"什么值得买排行榜 is disabled due to the lack of SMZDM_COOKIE","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/smzdm/haowen.ts","lineNumber":48,"sourceCode":"            {\n                name: 'SMZDM_COOKIE',\n                description: '什么值得买登录后的 Cookie 值',\n            },\n        ],\n        requirePuppeteer: false,\n        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n    },\n    name: '好文',\n    maintainers: ['LogicJake', 'pseudoyu'],\n    handler,\n};\n\nasync function handler(ctx) {\n    if (!config.smzdm.cookie) {\n        throw new ConfigNotFoundError('什么值得买排行榜 is disabled due to the lack of SMZDM_COOKIE');\n    }\n\n    const day = ctx.req.param('day') ?? '1';\n    const link = `https://post.smzdm.com/hot_${day}/`;\n\n    const response = await ofetch(link, {\n        headers: getHeaders(),\n    });\n    const $ = load(response);\n    const title = $('li.filter-tab.active').text();\n\n    const list = $('li.feed-row-wide')\n        .toArray()\n        .map((item) => {\n            const $item = $(item);\n            return {\n                title: $item.find('h5.z-feed-title a').text(),\n                link: $item.find('h5.z-feed-title a').attr('href'),","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/smzdm/haowen.ts#L30-L66","documentation":"Thrown as a ConfigNotFoundError when config.smzdm.cookie is falsy in the SMZDM good-articles (haowen) route (/smzdm/haowen/:day). The route scrapes post.smzdm.com/hot_<day>/ which requires a cookie for anti-crawler access. The error message '排行榜' (rankings) is a copy-paste artifact — this route fetches hot good-articles by day, not rankings.","triggerScenarios":"The RSSHub instance has not set SMZDM_COOKIE. Any request to /smzdm/haowen/:day triggers this guard at handler entry.","commonSituations":"Self-hosted RSSHub without SMZDM_COOKIE; cookie expired; public instance without SMZDM support.","solutions":["Set SMZDM_COOKIE with a valid session cookie from a logged-in smzdm.com session.","Refresh the cookie if it expired and restart RSSHub.","Use unauthenticated SMZDM routes if credentials are unavailable."],"exampleFix":"# before\n# (SMZDM_COOKIE not set)\n\n# after (.env)\nSMZDM_COOKIE=smzdm_id=...; smzdm_sess=...; usera=...;","handlingStrategy":"validation","validationCode":"if (!config.smzdm?.cookie) {\n    throw new ConfigNotFoundError('SMZDM good-articles RSS requires SMZDM_COOKIE.');\n}","typeGuard":"function hasSmzdmCookie(cfg: typeof config): cfg is typeof config & { smzdm: { cookie: string } } {\n    return !!cfg.smzdm && typeof cfg.smzdm.cookie === 'string' && cfg.smzdm.cookie.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Set SMZDM_COOKIE during initial RSSHub deployment if SMZDM routes are needed.","Schedule regular cookie refreshes since SMZDM sessions expire.","Fix the copy-paste error message to say '好文' instead of '排行榜' for clarity."],"tags":["config","authentication","smzdm","env-vars","cookie"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}