{"record":{"id":"62596f69abf266fa","repo":"jackwener/OpenCLI","slug":"not-found-62596f","errorCode":"NOT_FOUND","errorMessage":"NOT_FOUND: No episodes found","messagePattern":"NOT_FOUND: No episodes found","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"warning","filePath":"clis/apple-podcasts/episodes.js","lineNumber":22,"sourceCode":"cli({\n    site: 'apple-podcasts',\n    name: 'episodes',\n    access: 'read',\n    description: 'List recent episodes of an Apple Podcast (use ID from search)',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'id', positional: true, required: true, help: 'Podcast ID (collectionId from search output)' },\n        { name: 'limit', type: 'int', default: 15, help: 'Max episodes to show' },\n    ],\n    columns: ['title', 'duration', 'date'],\n    func: async (args) => {\n        const limit = Math.max(1, Math.min(Number(args.limit), 200));\n        // results[0] is the podcast itself; the rest are episodes\n        const data = await itunesFetch(`/lookup?id=${args.id}&entity=podcastEpisode&limit=${limit + 1}`);\n        const episodes = (data.results ?? []).filter((r) => r.kind === 'podcast-episode');\n        if (!episodes.length)\n            throw new CliError('NOT_FOUND', 'No episodes found', 'Check the podcast ID from: opencli apple-podcasts search <keyword>');\n        return episodes.slice(0, limit).map((ep) => ({\n            title: ep.trackName,\n            duration: formatDuration(ep.trackTimeMillis),\n            date: formatDate(ep.releaseDate),\n        }));\n    },\n});\n","sourceCodeStart":4,"sourceCodeEnd":30,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/apple-podcasts/episodes.js#L4-L30","documentation":"Thrown by `apple-podcasts episodes` as a CliError with code NOT_FOUND when the iTunes lookup for the given podcast id returns no results with kind === 'podcast-episode'. results[0] is the podcast itself; if no episode entries follow, there is nothing to list. The hint points users at the search command to find a valid id.","triggerScenarios":"`opencli apple-podcasts episodes --id <id>` where /lookup?id=...&entity=podcastEpisode returns a payload whose results array, after filtering to kind==='podcast-episode', is empty.","commonSituations":"Passing a non-podcast collectionId (e.g. a song or app id); a podcast with zero published episodes; an id whose lookup returns only the podcast record but no episodes (feed temporarily unavailable); typo'd or stale id.","solutions":["Verify the id with `opencli apple-podcasts search <keyword>` and use the id it prints","Confirm the show actually has published episodes in the Apple Podcasts app","Retry later — the iTunes feed occasionally returns partial results"],"exampleFix":"// before\nopencli apple-podcasts episodes --id 120036366  // id is actually an app\n// after\nopencli apple-podcasts search \"daily news\"\nopencli apple-podcasts episodes --id <id-from-search>","handlingStrategy":"try-catch","validationCode":"// Pre-check the id resolves to a podcast with episodes\nconst res = await fetch(`https://itunes.apple.com/lookup?id=${id}&entity=podcastEpisode&limit=2`);\nconst data = await res.json();\nconst hasEpisodes = (data.results ?? []).some((r) => r.kind === 'podcast-episode');\nif (!hasEpisodes) console.log('No episodes for this id — verify via apple-podcasts search.');","typeGuard":"function isPodcastEpisode(r) {\n  return r != null && typeof r === 'object' && r.kind === 'podcast-episode';\n}","tryCatchPattern":"try {\n  await cli.run(['apple-podcasts', 'episodes', '--id', String(id)]);\n} catch (e) {\n  if (e.code === 'NOT_FOUND') {\n    console.log('No episodes found; check the ID via apple-podcasts search.');\n  } else throw e;\n}","preventionTips":["Always source the id from `apple-podcasts search`, not hand-copied numbers","Confirm the show has published episodes before automating lookups","Retry occasionally — the iTunes feed can return partial results transiently"],"tags":["not-found","itunes-api","apple-podcasts"],"backgroundTag":"resource-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}