{"record":{"id":"e2f3f2042c3a91ed","repo":"jackwener/OpenCLI","slug":"bilibili-creator-stats-bvid","errorCode":null,"errorMessage":"bilibili creator-stats ${bvid}","messagePattern":"bilibili creator-stats (.+?)","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/bilibili/creator-stats.js","lineNumber":105,"sourceCode":"            throw new AuthRequiredError('member.bilibili.com', `Bilibili creator-center login is required: ${detail}`);\n        }\n        throw new CommandExecutionError(`Bilibili creator comparison request failed: ${detail}`);\n    }\n}\n\nfunction selectTarget(list, bvid) {\n    const matches = [];\n    for (const item of list) {\n        if (!isRecord(item) || typeof item.bvid !== 'string' || !/^BV[0-9A-Za-z]{10}$/.test(item.bvid)) {\n            throw new CommandExecutionError('Bilibili creator comparison returned a malformed manuscript row');\n        }\n        if (item.bvid === bvid) matches.push(item);\n    }\n    if (matches.length > 1) {\n        throw new CommandExecutionError(`Bilibili creator comparison returned duplicate rows for ${bvid}`);\n    }\n    if (matches.length === 0) {\n        throw new EmptyResultError(\n            `bilibili creator-stats ${bvid}`,\n            'The manuscript was not present in the latest 100 creator analytics rows; it may be older, not owned by this account, or not analyzed yet.',\n        );\n    }\n    const target = matches[0];\n    if (!isRecord(target.stat)) {\n        throw new CommandExecutionError(`Bilibili creator comparison returned malformed stat data for ${bvid}`);\n    }\n    return target;\n}\n\nfunction metricValue(target, definition) {\n    const source = definition.source === 'target' ? target : target.stat;\n    if (!Object.prototype.hasOwnProperty.call(source, definition.key)) {\n        throw new CommandExecutionError(`Bilibili creator comparison omitted metric ${definition.key}`);\n    }\n    const raw = source[definition.key];\n    if (raw === null) return null;","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/bilibili/creator-stats.js#L87-L123","documentation":"If no row in the latest 100 comparison rows matches the requested bvid, selectTarget throws EmptyResultError with the query identifier 'bilibili creator-stats <bvid>'. Unlike the other errors this is an 'empty result' signal, not a failure: the request succeeded but the manuscript simply was not in the returned analytics window. The hint explains the likely reasons.","triggerScenarios":"fetchComparison returned a valid list, every row passed whitelisting, but none has item.bvid === the requested BV — the video is outside the latest-100 window, not owned by this account, or has no analytics yet.","commonSituations":"Querying a video older than the most recent 100 manuscripts; typo'd or wrong-case BV ID (matching is case-sensitive); querying another creator's video while logged into your own account; brand-new upload not yet analyzed.","solutions":["Double-check the BV ID for typos and case (or pass the full video URL, which parseBvidOrVideoUrl normalizes)","Wait and retry — new uploads may take time before creator analytics are generated","Verify the logged-in account owns the manuscript; the endpoint only returns the current account's rows","If the video is older than your latest 100 uploads, it is outside this endpoint's window — use another data source"],"exampleFix":"// before: wrong-case / wrong video\n$ opencli bilibili creator-stats bv1xx411c7mD\nEmptyResultError: bilibili creator-stats bv1xx411c7mD — not present in latest 100 rows\n\n// after: exact case-sensitive BV or full URL\n$ opencli bilibili creator-stats BV1xx411c7mD","handlingStrategy":"validation","validationCode":"const bvid = 'BV1xx411c7mD';\nif (!/^BV[0-9A-Za-z]{10}$/.test(bvid)) throw new Error('Invalid BV ID — must be BV followed by 10 alphanumeric chars (case-sensitive)');","typeGuard":"function isValidBvid(v) {\n  return typeof v === 'string' && /^BV[0-9A-Za-z]{10}$/.test(v);\n}","tryCatchPattern":"try {\n  const rows = await runCommand();\n} catch (e) {\n  if (e.name === 'EmptyResultError') {\n    // not an outage: check BV spelling/case, account ownership, analytics lag, or 100-row window\n  } else throw e;\n}","preventionTips":["Validate the BV ID format and case before invoking (or pass the full URL to normalize)","Confirm the logged-in account owns the manuscript — the endpoint only returns your own rows","Allow time after upload for analytics to be generated; retry later","Remember the endpoint only covers the latest ~100 manuscripts; use another source for older videos"],"tags":["bilibili","empty-result","not-found","query-parameters"],"backgroundTag":"empty-result-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}