{"record":{"id":"7920b33d79d9b618","repo":"DIYgod/RSSHub","slug":"id-https-www-jisilu-cn-users","errorCode":null,"errorMessage":"请填入合法的用户 id，参见用户排名 https://www.jisilu.cn/users/","messagePattern":"请填入合法的用户 id，参见用户排名 https://www\\.jisilu\\.cn/users/","errorType":"exception","errorClass":"InvalidParameterError","httpStatus":null,"severity":"error","filePath":"lib/routes/jisilu/people.ts","lineNumber":35,"sourceCode":"\nexport const handler = async (ctx: Context): Promise<Data> => {\n    const { id, type = 'questions' } = ctx.req.param();\n\n    if (type && type !== 'answers' && type !== 'questions') {\n        throw new InvalidParameterError('请填入合法的类型 id，可选值为 `questions` 即 `主题` 或 `answer` 即 `回复`，默认为空，即全部');\n    }\n\n    const limit = Number(ctx.req.query('limit') ?? '30');\n\n    const targetUrl: string = new URL(`/people/${id}`, rootUrl).href;\n\n    const response = await ofetch(targetUrl);\n    const $: CheerioAPI = load(response);\n    const language: string = $('html').prop('lang') ?? 'zh';\n    const userId: string | undefined = response.match(/var\\sPEOPLE_USER_ID\\s=\\s'(\\d+)';/)?.[1];\n\n    if (!userId) {\n        throw new InvalidParameterError('请填入合法的用户 id，参见用户排名 https://www.jisilu.cn/users/');\n    }\n\n    const apiUrl: string = new URL(`people/ajax/user_actions/uid-${userId}__actions-${actions[type]}__page-1`, rootUrl).href;\n\n    const detailResponse = await ofetch(apiUrl);\n    const $$: CheerioAPI = load(detailResponse);\n\n    const items: DataItem[] = await processItems($$, $$('*') as Cheerio<Element>, limit);\n\n    const author = $('meta[name=\"keywords\"]').prop('content').split(/,/, 1)[0];\n    const feedImage = $('div.aw-logo img').prop('src');\n\n    return {\n        title: `${$('title').text()}${type ? ` - ${$(`div#${type} h3`).text()}` : ''}`,\n        description: $('meta[name=\"description\"]').prop('content'),\n        link: targetUrl,\n        item: items,\n        allowEmpty: true,","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/jisilu/people.ts#L17-L53","documentation":"Thrown by the jisilu people handler as InvalidParameterError when the regex `/var\\s+PEOPLE_USER_ID\\s=\\s'(\\d+)';/` does not match against the fetched /people/<id> page HTML, leaving userId undefined. Without userId the handler cannot build the AJAX endpoint `people/ajax/user_actions/uid-<id>__actions-<code>__page-1`.","triggerScenarios":"The /people/<id> page loads (HTTP 200) but no longer contains the inline `var PEOPLE_USER_ID = '<digits>';` declaration — either because the id is invalid and the site shows a 'user not found' page, the user was deleted, or 集思录 restructured its template and renamed the variable.","commonSituations":"Wrong/non-existent user id; user account deleted/suspended; site template rebuilt renaming PEOPLE_USER_ID; anti-bot interstitial page returned instead of the profile.","solutions":["Confirm the user id exists by opening https://www.jisilu.cn/people/<id> and checking it shows a real profile (not a 404)","If the variable was renamed, update the regex in lib/routes/jisilu/people.ts:30 to the new pattern","Verify ofetch actually received the profile HTML (not a login wall or challenge) by logging a snippet of the response","Consider extracting the userId from a JSON island or a data-* attribute if 集思录 migrated away from inline globals"],"exampleFix":"// before\nconst userId: string | undefined = response.match(/var\\sPEOPLE_USER_ID\\s=\\s'(\\d+)';/)?.[1];\nif (!userId) {\n    throw new InvalidParameterError('请填入合法的用户 id ...');\n}\n// after\nconst userId: string | undefined =\n    response.match(/var\\s+PEOPLE_USER_ID\\s*=\\s*'(\\d+)';/)?.[1]\n    ?? load(response)('[data-uid]').attr('data-uid');\nif (!userId) {\n    throw new InvalidParameterError(`请填入合法的用户 id (got '${id}'), 参见 https://www.jisilu.cn/users/`);\n}","handlingStrategy":"try-catch","validationCode":"// Probe whether the user page exposes a PEOPLE_USER_ID before parsing\nasync function userPageHasId(targetUrl: string): Promise<boolean> {\n  const resp = await ofetch(targetUrl);\n  return /var\\s+PEOPLE_USER_ID\\s*=\\s*'\\d+';/.test(resp);\n}","typeGuard":"function hasUserId(match: RegExpMatchArray | null): match is RegExpMatchArray {\n  return match !== null && /^\\d+$/.test(match[1]);\n}","tryCatchPattern":"try {\n  return await handler(ctx);\n} catch (e) {\n  if (e instanceof InvalidParameterError && /用户 id/.test(e.message)) {\n    // could be a deleted user or a template change — re-throw with the URL for diagnosis\n    throw new InvalidParameterError(`Could not resolve user id at ${targetUrl}: user deleted or site restructured`);\n  }\n  throw e;\n}","preventionTips":["Maintain multiple extraction strategies for the userId (inline global, data-attribute, JSON island)","Verify the user exists before subscribing (open the profile URL)","Pin a User-Agent so anti-bot pages don't replace the profile HTML","Log response length/snippet when the regex misses"],"tags":["scraping","html-parsing","parameter","site-restructure"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}