{"record":{"id":"c587135a6246fa74","repo":"DIYgod/RSSHub","slug":"is-disabled-due-to-the-lack-of-smzdm-cook-c58713","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/baoliao.ts","lineNumber":43,"sourceCode":"        requirePuppeteer: false,\n        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n    },\n    radar: [\n        {\n            source: ['zhiyou.smzdm.com/member/:uid/baoliao'],\n        },\n    ],\n    name: '用户爆料',\n    maintainers: ['nczitzk'],\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 link = `https://zhiyou.smzdm.com/member/${ctx.req.param('uid')}/baoliao/`;\n\n    const response = await got(link, {\n        headers: getHeaders(),\n    });\n    const $ = load(response.data);\n    const title = $('.info-stuff-nickname').text();\n\n    const list = $('.pandect-content-stuff')\n        .toArray()\n        .map((item): DataItem => {\n            const $item = $(item);\n            return {\n                title: $item.find('.pandect-content-title a').text(),\n                link: $item.find('.pandect-content-title a').attr('href'),\n                pubDate: timezone(parseDate($item.find('.pandect-content-time').text(), ['YYYY-MM-DD', 'MM-DD HH:mm']), 8),","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/smzdm/baoliao.ts#L25-L61","documentation":"Thrown as a ConfigNotFoundError when config.smzdm.cookie is falsy in the SMZDM user-tips (baoliao) route (/smzdm/baoliao/:uid). Identical guard pattern to other SMZDM routes. The error message text '排行榜' (rankings) is a copy-paste artifact — this route is for user baoliao submissions, not rankings. The route scrapes the authenticated zhiyou.smzdm.com portal and needs a valid session cookie.","triggerScenarios":"The RSSHub instance has not set SMZDM_COOKIE. Any request to /smzdm/baoliao/:uid triggers this guard before any HTTP call is made.","commonSituations":"Self-hosted RSSHub without SMZDM_COOKIE; cookie expired; or using a public instance without SMZDM support.","solutions":["Set SMZDM_COOKIE with a valid session cookie extracted from a logged-in smzdm.com browser session.","Refresh the cookie if it expired and restart RSSHub.","Use unauthenticated SMZDM routes if you cannot provide credentials."],"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 user baoliao 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"}