{"record":{"id":"cae47361bb06a5da","repo":"jackwener/OpenCLI","slug":"bilibili-has-not-generated-an-ai-summary-for-bvi","errorCode":null,"errorMessage":"Bilibili has not generated an AI summary for ${bvid}.","messagePattern":"Bilibili has not generated an AI summary for (.+?)\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/bilibili/summary.js","lineNumber":77,"sourceCode":"    if (!payload || typeof payload !== 'object' || Array.isArray(payload)) {\n        throw new CommandExecutionError(`Bilibili ${label} API returned a malformed payload`);\n    }\n    if (payload.code !== 0) {\n        const message = payload.message ?? 'unknown error';\n        if (payload.code === -101 || payload.code === -403 || /登录|权限|forbidden|permission|login/i.test(String(message))) {\n            throw new AuthRequiredError('bilibili.com', `Bilibili ${label} API requires login or permission: ${message} (${payload.code})`);\n        }\n        throw new CommandExecutionError(`Bilibili ${label} API failed: ${message} (${payload.code})`);\n    }\n    return payload.data;\n}\n\nfunction readModelResult(data, bvid) {\n    if (!data || typeof data !== 'object' || Array.isArray(data)) {\n        throw new CommandExecutionError('Bilibili conclusion API returned malformed data');\n    }\n    if (data.code !== 0) {\n        throw new EmptyResultError('bilibili summary', `Bilibili has not generated an AI summary for ${bvid}.`);\n    }\n    let modelResult = data.model_result;\n    if (typeof modelResult === 'string') {\n        try {\n            modelResult = JSON.parse(modelResult);\n        } catch {\n            throw new CommandExecutionError('Bilibili conclusion API returned malformed model_result JSON');\n        }\n    }\n    if (!modelResult || typeof modelResult !== 'object' || Array.isArray(modelResult)) {\n        throw new CommandExecutionError('Bilibili conclusion API returned malformed model_result');\n    }\n    const summary = String(modelResult.summary ?? '').trim();\n    if (!summary) {\n        throw new EmptyResultError('bilibili summary', `Bilibili has not generated an AI summary for ${bvid}.`);\n    }\n    const outline = modelResult.outline ?? [];\n    if (!Array.isArray(outline)) {","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/bilibili/summary.js#L59-L95","documentation":"readModelResult() throws this EmptyResultError when the conclusion endpoint reports data.code !== 0 for the requested video — Bilibili's signal that no AI summary has been generated for that video (not all videos have one; generation depends on duration, content, and availability). It is an expected empty result, not a crash: the library surfaces it so callers can fall back to another summarization method.","triggerScenarios":"Querying the conclusion API for a short video, a newly uploaded video, an audio/管理-type submission, or any video for which Bilibili has not produced the AI 总结 — the payload carries data.code non-zero (e.g. -400 request OK but no summary) and readModelResult at summary.js:76-78 converts it to EmptyResultError.","commonSituations":"Batch-summarizing videos where some simply lack AI summaries; summarizing very fresh uploads minutes after publish; videos where the AI summary feature was disabled; users expecting every video to have a summary.","solutions":["Handle EmptyResultError as an expected outcome — skip the video or fall back to your own summarization (e.g. fetch subtitles and summarize locally).","Retry later: summaries are generated asynchronously and may appear after a delay for new uploads.","Check the video page in a browser to confirm whether an AI summary exists.","If running batch jobs, pre-filter videos known to lack summaries to reduce noise."],"exampleFix":"// before\nconst summary = await runSummaryCommand(bvid); // throws EmptyResultError\n// after\ntry {\n  const summary = await runSummaryCommand(bvid);\n} catch (e) {\n  if (isEmptyResult(e)) return fallbackLocalSummary(bvid);\n  throw e;\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await summaryCommand(bvid);\n} catch (e) {\n  if (e.name === 'EmptyResultError' || /has not generated an AI summary/.test(e.message)) {\n    return localFallbackSummary(bvid); // e.g. fetch subtitles and summarize\n  }\n  throw e;\n}","preventionTips":["Treat missing AI summaries as normal for short/new videos — build a fallback path.","For fresh uploads, retry after a delay before giving up.","When batching, catch EmptyResultError per video instead of aborting the whole run.","Verify in a browser whether the video shows an AI summary before reporting it as a bug."],"tags":["empty-result","bilibili","ai-summary","fallback"],"backgroundTag":"empty-result-no-content","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}