{"record":{"id":"bf78c4def810ea51","repo":"DIYgod/RSSHub","slug":"this-category-does-not-exist-please-refer-to-the","errorCode":null,"errorMessage":"This category does not exist. Please refer to the documentation for the correct usage.","messagePattern":"This category does not exist\\. Please refer to the documentation for the correct usage\\.","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":503,"severity":"error","filePath":"lib/routes/36kr/hot-list.ts","lineNumber":67,"sourceCode":"    description: `| 24 小时热榜 | 资讯人气榜 | 资讯综合榜 | 资讯收藏榜 |\n| ----------- | ---------- | ---------- | ---------- |\n| 24          | renqi      | zonghe     | shoucang   |`,\n};\n\nconst getProperty = (object, key) => {\n    let result = object;\n    const keys = key.split('.');\n    for (const k of keys) {\n        result &&= result[k];\n    }\n    return result;\n};\n\nasync function handler(ctx) {\n    const category = ctx.req.param('category') ?? '24';\n\n    if (!Object.hasOwn(categories, category)) {\n        throw new InvalidParameterError('This category does not exist. Please refer to the documentation for the correct usage.');\n    }\n\n    const currentUrl = category === '24' ? rootUrl : `${rootUrl}/hot-list/catalog`;\n\n    const wafTokenId = await getWafTokenId();\n    const response = await got({\n        method: 'get',\n        url: currentUrl,\n        headers: {\n            Cookie: `_waftokenid=${wafTokenId}`,\n        },\n    });\n\n    const data = getProperty(JSON.parse(response.data.match(/window.initialState=(\\{.*\\})/)[1]), categories[category].key);\n\n    let items = data\n        .slice(0, ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 10)\n        .filter((item) => item.itemType !== 0)","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/36kr/hot-list.ts#L49-L85","documentation":"The 36kr hot-list route accepts a fixed set of category keys (24, renqi, zonghe, shoucang). Object.hasOwn(categories, category) rejects anything else before the route requests the hot-list page or its WAF-guarded API.","triggerScenarios":"Calling /36kr/hot-list/:category with a value outside {24, renqi, zonghe, shoucang} — e.g. using the numeric position '1/2/3/4', a trailing slash, or wrong case.","commonSituations":"Confusing the ordinal column number with the slug; trailing slash producing an empty string; case mismatch ('Renqi' vs 'renqi').","solutions":["Use one of the literal keys: 24, renqi, zonghe, shoucang.","Omit the segment to default to '24' (24-hour hot list)."],"exampleFix":"// before\n/36kr/hot-list/2          // ordinal, not the slug\n// after\n/36kr/hot-list/renqi","handlingStrategy":"validation","validationCode":"const CATEGORIES_36KR = new Set(['24', 'renqi', 'zonghe', 'shoucang']);\nfunction valid36krCategory(c) {\n  return CATEGORIES_36KR.has(String(c));\n}","typeGuard":"function is36krCategory(c): c is '24'|'renqi'|'zonghe'|'shoucang' {\n  return ['24','renqi','zonghe','shoucang'].includes(c);\n}","tryCatchPattern":null,"preventionTips":["Use the slug keys, not ordinal column numbers.","Normalise to string before the lookup (24 vs '24').","Omit the segment for the default '24' rather than passing nothing-as-string."],"tags":["validation","parameter","enum","rsshub"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}