jackwener/OpenCLI · error · CliError

NOT_FOUND

NOT_FOUND

Error message

NOT_FOUND

What it means

GET /v1/episode/get for the given eid returned no episode object, so the CLI throws CliError NOT_FOUND with hint 'Please check the episode ID'. This check runs before extracting the transcript mediaId, since nothing can proceed without the episode payload.

Source

Thrown at clis/xiaoyuzhou/transcript.js:34

        { name: 'id', positional: true, required: true, help: 'Episode ID (eid from podcast-episodes output)' },
        { name: 'output', default: './xiaoyuzhou-transcripts', help: 'Output directory' },
        { name: 'json', type: 'boolean', default: true, help: 'Save transcript JSON file' },
        { name: 'text', type: 'boolean', default: true, help: 'Save extracted transcript text file' },
    ],
    columns: ['title', 'podcast', 'status', 'segments', 'json_file', 'text_file'],
    func: async (kwargs) => {
        if (kwargs.json === false && kwargs.text === false) {
            throw new ArgumentError('At least one of --json or --text must be enabled', 'Example: opencli xiaoyuzhou transcript 69dd0c98e2c8be31551f6a33 --text true');
        }
        let credentials = loadXiaoyuzhouCredentials();
        const episodeResponse = await requestXiaoyuzhouJson('/v1/episode/get', {
            query: { eid: kwargs.id },
            credentials,
        });
        credentials = episodeResponse.credentials;
        const episode = episodeResponse.data;
        if (!episode) {
            throw new CliError('NOT_FOUND', 'Episode not found', 'Please check the episode ID');
        }
        const mediaId = String(episode.transcript?.mediaId || episode.media?.id || episode.transcriptMediaId || '').trim();
        if (!mediaId) {
            throw new CliError('PARSE_ERROR', 'mediaId not found in episode payload', 'Transcript metadata requires episode.transcript.mediaId, episode.media.id, or episode.transcriptMediaId');
        }
        const transcriptResponse = await requestXiaoyuzhouJson('/v1/episode-transcript/get', {
            method: 'POST',
            body: {
                eid: kwargs.id,
                mediaId,
            },
            credentials,
        });
        const transcriptMeta = transcriptResponse.data;
        const transcriptUrl = String(transcriptMeta?.transcriptUrl || transcriptMeta?.url || '').trim();
        if (!transcriptUrl) {
            throw new CliError('EMPTY_RESULT', 'Transcript URL not found', 'This episode may not have transcript data available');
        }

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the episode ID (eid) is correct and complete
  2. Confirm the episode still exists in the xiaoyuzhou app
  3. Re-authenticate / refresh credentials and retry
  4. Use the podcast-episodes command to list valid eids for the podcast

Example fix

// before
opencli xiaoyuzhou transcript <pid>
// after
opencli xiaoyuzhou transcript 69dd0c98e2c8be31551f6a33
Defensive patterns

Strategy: try-catch

Validate before calling

if (typeof eid !== 'string' || eid.length < 16) throw new Error('eid looks invalid');

Try / catch

try { await transcript(eid); } catch (e) { if (String(e).includes('NOT_FOUND')) { console.error(`Episode ${eid} not found; check eid or re-auth`); return null; } throw e; }

Prevention

When it happens

Trigger: Calling `opencli xiaoyuzhou transcript <eid>` with an eid that doesn't exist, has been deleted, is behind a paywall/private episode, or credentials lacking access to that episode.

Common situations: Transcribing an episode that was taken down, typos or truncation in the eid, using a pid instead of an eid, or expired credentials making the API return an empty data payload.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/1cf57172ce4a42f0. Report an issue: GitHub.