{"record":{"id":"a9158cb5111a0dfb","repo":"jackwener/OpenCLI","slug":"40362","errorCode":"40362","errorMessage":"Zhihu risk control blocked ${label} (40362): ${payload.__errorMessage || 'abnormal request'}","messagePattern":"Zhihu risk control blocked (.+?) \\(40362\\): (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/zhihu/answer-comments-helpers.js","lineNumber":69,"sourceCode":"        return !response.ok || result.__errorCode || result.__errorMessage || result.__needLogin ? result : body;\n    }, url).catch((error) => {\n        throw new CommandExecutionError(\n            `Zhihu ${label} request failed: ${error instanceof Error ? error.message : String(error)}`,\n            'Try again later or rerun with -v for more detail.',\n        );\n    });\n    const payload = unwrapEvaluateResult(evaluated);\n    if (payload?.__malformedJson) {\n        throw new CommandExecutionError(`Zhihu ${label} returned malformed JSON: ${payload.__malformedJson}`);\n    }\n    if (!payload || typeof payload !== 'object' || Array.isArray(payload)) {\n        throw new CommandExecutionError(`Zhihu ${label} returned a malformed payload`);\n    }\n    const status = payload.__httpStatus;\n    const code = String(payload.__errorCode || '');\n    if (status >= 400 || code || payload.__errorMessage || payload.__needLogin) {\n        if (code === '40362') {\n            throw new CommandExecutionError(\n                `Zhihu risk control blocked ${label} (40362): ${payload.__errorMessage || 'abnormal request'}`,\n                'Open the answer in the connected Chrome profile and retry later.',\n            );\n        }\n        if (status === 401 || status === 403 || code === '40353' || payload.__needLogin) {\n            throw new AuthRequiredError('www.zhihu.com', `Failed to fetch Zhihu ${label}`);\n        }\n        if (status === 404 && notFoundDetail) throw new EmptyResultError('zhihu answer-comments', notFoundDetail);\n        if (status >= 400) throw new CommandExecutionError(`Zhihu ${label} request failed (HTTP ${status})`);\n        throw new CommandExecutionError(`Zhihu ${label} returned an error payload: ${payload.__errorMessage || code}`);\n    }\n    if (!Array.isArray(payload.data) || !payload.paging || typeof payload.paging !== 'object') {\n        throw new CommandExecutionError(`Zhihu ${label} returned a malformed payload`);\n    }\n    if (typeof payload.paging.is_end !== 'boolean') {\n        throw new CommandExecutionError(`Zhihu ${label} returned malformed paging state`);\n    }\n    return payload;","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/zhihu/answer-comments-helpers.js#L51-L87","documentation":"Zhihu's API responded with errorCode 40362, its risk-control / abnormal-request signal. The library raises a dedicated CommandExecutionError telling the user to open the answer in the connected Chrome profile and retry, because automated requests have been flagged. This is an anti-bot block, not a code bug.","triggerScenarios":"payload.__errorCode === '40362' on the comment fetch — Zhihu flagged the request as automated or abnormal (too-frequent polling, missing browser fingerprint cues, datacenter IP).","commonSituations":"Scraping too aggressively in a loop; running from a cloud/datacenter IP; profile cookies degraded after long idle; Zhihu tightening risk control during high-traffic periods.","solutions":["Open the answer URL in the connected Chrome profile and interact manually until the block clears, then retry","Add delays/backoff between page fetches to reduce request frequency","Use a residential/logged-in profile and avoid datacenter IPs","Wait (hours if needed) — 40362 blocks are usually temporary"],"exampleFix":"// before\nfor (const url of urls) await fetchCommentPage(url); // tight loop -> 40362\n// after\nfor (const url of urls) {\n  await fetchCommentPage(url);\n  await new Promise(r => setTimeout(r, 3000 + Math.random() * 2000)); // jittered delay\n}","handlingStrategy":"retry","validationCode":"// pre-check recent request volume before calling\nif (requestsInLastMinute >= 10) await sleep(60000);","typeGuard":null,"tryCatchPattern":"try { await fetchCommentPage(url); } catch (e) { if (e.message.includes('40362')) { await openInProfileAndAwaitHumanCheck(url); await sleep(cooldownMs); return fetchCommentPage(url); } throw e; }","preventionTips":["Add jittered delays between page fetches","Use a logged-in residential Chrome profile, not datacenter automation","Cap pages per run and spread large jobs over time","On 40362, back off for minutes/hours instead of retrying immediately"],"tags":["zhihu","rate-limit","anti-bot","risk-control"],"backgroundTag":"rate-limited-by-server","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}