{"record":{"id":"25d7ad4039484518","repo":"jackwener/OpenCLI","slug":"empty-result-25d7ad","errorCode":"EMPTY_RESULT","errorMessage":"EMPTY_RESULT","messagePattern":"EMPTY_RESULT","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"warning","filePath":"clis/xiaoyuzhou/transcript.js","lineNumber":51,"sourceCode":"        if (!episode) {\n            throw new CliError('NOT_FOUND', 'Episode not found', 'Please check the episode ID');\n        }\n        const mediaId = String(episode.transcript?.mediaId || episode.media?.id || episode.transcriptMediaId || '').trim();\n        if (!mediaId) {\n            throw new CliError('PARSE_ERROR', 'mediaId not found in episode payload', 'Transcript metadata requires episode.transcript.mediaId, episode.media.id, or episode.transcriptMediaId');\n        }\n        const transcriptResponse = await requestXiaoyuzhouJson('/v1/episode-transcript/get', {\n            method: 'POST',\n            body: {\n                eid: kwargs.id,\n                mediaId,\n            },\n            credentials,\n        });\n        const transcriptMeta = transcriptResponse.data;\n        const transcriptUrl = String(transcriptMeta?.transcriptUrl || transcriptMeta?.url || '').trim();\n        if (!transcriptUrl) {\n            throw new CliError('EMPTY_RESULT', 'Transcript URL not found', 'This episode may not have transcript data available');\n        }\n        const transcriptBody = await fetchXiaoyuzhouTranscriptBody(transcriptUrl);\n        const { text, segmentCount } = extractTranscriptText(transcriptBody);\n        if (kwargs.text !== false && transcriptBody.trim() && !text.trim()) {\n            throw new CliError('PARSE_ERROR', 'Failed to extract transcript text', 'Transcript payload format is unsupported. Re-run with --json true to inspect the raw payload.');\n        }\n        const outputDir = path.join(String(kwargs.output || './xiaoyuzhou-transcripts'), String(kwargs.id));\n        fs.mkdirSync(outputDir, { recursive: true });\n        const jsonPath = path.join(outputDir, 'transcript.json');\n        const textPath = path.join(outputDir, 'transcript.txt');\n        if (kwargs.json !== false) {\n            fs.writeFileSync(jsonPath, transcriptBody, 'utf-8');\n        }\n        if (kwargs.text !== false) {\n            fs.writeFileSync(textPath, text, 'utf-8');\n        }\n        return [{\n                title: episode.title || 'episode',","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xiaoyuzhou/transcript.js#L33-L69","documentation":"The transcript metadata response contained neither `transcriptUrl` nor `url`, so the CLI throws CliError EMPTY_RESULT with the hint that the episode may not have transcript data available. This distinguishes 'no transcript exists' from a hard parse failure.","triggerScenarios":"Calling the transcript command for an episode whose /v1/episode-transcript/get response has empty/absent transcriptUrl and url fields — typically episodes without generated transcripts or a metadata-only empty payload.","commonSituations":"Very new or very old episodes without ASR transcripts, episodes where transcript generation is still pending, region/permission-restricted metadata, or API responses degraded to empty objects during incidents.","solutions":["Confirm the episode shows a transcript in the xiaoyuzhou app before retrying","Retry later if the transcript is still generating","Verify the eid belongs to a transcript-enabled episode type","Check xiaoyuzhou service status if many episodes return empty metadata"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const meta = transcriptResponse?.data;\nconst url = String(meta?.transcriptUrl || meta?.url || '').trim();\nif (!url) return null; // no transcript available","typeGuard":"const hasTranscriptUrl = (m) => Boolean(m && (m.transcriptUrl || m.url));","tryCatchPattern":"try { await transcript(eid); } catch (e) { if (String(e).includes('EMPTY_RESULT')) { console.warn('No transcript available for this episode'); return null; } throw e; }","preventionTips":["Treat missing transcripts as expected for some episodes","Retry later for episodes with pending transcript generation","Pre-verify transcript availability in the app","Batch-run with per-episode error tolerance"],"tags":["cli","empty-result","transcript"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}