{"record":{"id":"e741baaa2decd0ad","repo":"jackwener/OpenCLI","slug":"no-downloadable-media-found","errorCode":null,"errorMessage":"No downloadable media found","messagePattern":"No downloadable media found","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/instagram/download.js","lineNumber":362,"sourceCode":"    domain: 'www.instagram.com',\n    strategy: Strategy.COOKIE,\n    navigateBefore: false,\n    args: [\n        { name: 'url', positional: true, required: true, help: 'Instagram post / reel / tv URL' },\n        { name: 'path', default: '~/Downloads/Instagram', help: 'Download directory' },\n    ],\n    func: async (page, kwargs) => {\n        const browserPage = ensurePage(page);\n        const target = parseInstagramMediaTarget(String(kwargs.url ?? ''));\n        const outputRoot = resolveOutputDir(kwargs.path);\n        await browserPage.goto(target.canonicalUrl);\n        const fetchResult = normalizeFetchResult(await browserPage.evaluate(buildInstagramFetchScript(target.shortcode)));\n        if (!fetchResult.ok)\n            handleFetchFailure(fetchResult);\n        const shortcode = fetchResult.shortcode || target.shortcode;\n        const mediaItems = buildInstagramDownloadItems(shortcode, fetchResult.items || []);\n        if (mediaItems.length === 0) {\n            throw new CommandExecutionError('No downloadable media found');\n        }\n        const savedDir = path.join(outputRoot, shortcode);\n        await downloadInstagramMedia(mediaItems, savedDir);\n        console.log(`📁 saved: ${displayPath(savedDir)}`);\n        return null;\n    },\n});\n","sourceCodeStart":344,"sourceCodeEnd":370,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/instagram/download.js#L344-L370","documentation":"After a successful metadata fetch, the CLI maps fetchResult.items into downloadable items via buildInstagramDownloadItems; if the resulting list is empty it throws this CommandExecutionError. It means Instagram returned metadata for the shortcode but no media (image/video URLs) could be extracted — the post contains no downloadable media or the extraction didn't recognize the media shape.","triggerScenarios":"fetchResult.ok === true but items is empty or unrecognizable — e.g. a post type the mapper doesn't support (shared/IGTV edge cases), an unsupported media_type, or the metadata returned an empty carousel.","commonSituations":"Passing a profile URL, story URL, or non-post URL instead of a post/reel URL; Instagram introduced a new post type the CLI doesn't yet map; a post containing only unsupported content.","solutions":["Confirm the URL is a public post, reel, or TV URL (contains /p/, /reel/, or /tv/)","Upgrade the CLI to get support for newer Instagram post types","Try another post to determine whether it's URL-specific","Inspect fetchResult.items — if Instagram's shape changed, patch buildInstagramDownloadItems"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// only pass post/reel/tv URLs\nconst isPostUrl = /instagram\\.com\\/(p|reel|tv)\\/[A-Za-z0-9_-]+/.test(url);\nif (!isPostUrl) throw new Error('Provide a post, reel, or TV URL (contains /p/, /reel/ or /tv/)');","typeGuard":null,"tryCatchPattern":"try {\n  await run(['instagram', 'download', url]);\n} catch (e) {\n  if (String(e.message) === 'No downloadable media found') {\n    // verify URL type; skip or try the latest CLI with broader media support\n  } else throw e;\n}","preventionTips":["Validate the URL shape before invoking the command","Don't pass profile, story, or highlight URLs to the download command","Keep the CLI updated for new Instagram post types","Test with a known-good public post when debugging"],"tags":["instagram","empty-result","unsupported-content","url-validation"],"backgroundTag":"no-media-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}