{"record":{"id":"290171a1b02298c2","repo":"DIYgod/RSSHub","slug":"is-disabled-due-to-the-lack-of-smzdm-cook","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/article.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/article'],\n        },\n    ],\n    name: '用户文章',\n    maintainers: ['xfangbao'],\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')}/article/`;\n\n    const response = await got(link, {\n        headers: getHeaders(),\n    });\n    const $ = load(response.data);\n    const title = $('.info-stuff-nickname a').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/article.ts#L25-L61","documentation":"Thrown as a ConfigNotFoundError when config.smzdm.cookie is falsy in the SMZDM user-articles route (/smzdm/article/:uid). The route scrapes zhiyou.smzdm.com (the authenticated user portal) which requires a valid session cookie to return article lists. Note: the error message text says '排行榜' (rankings) which is a copy-paste artifact — this route is for user articles, not rankings. The cookie is obtained from the browser after logging into smzdm.com.","triggerScenarios":"The RSSHub instance has not set the SMZDM_COOKIE environment variable. Any request to /smzdm/article/:uid triggers this immediately at the top of the handler before any network call.","commonSituations":"Self-hosted RSSHub without configuring SMZDM_COOKIE; the cookie expired (SMZDM sessions are time-limited); or the operator is on a public instance that does not support authenticated SMZDM routes.","solutions":["Log into smzdm.com in a browser, copy the full Cookie header value from a request in the network tab, and set it as SMZDM_COOKIE in the RSSHub environment.","If the cookie expired, repeat the extraction and update the env var, then restart RSSHub.","If you cannot provide a cookie, these SMZDM routes are unavailable — use unauthenticated SMZDM routes instead."],"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 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"}