{"record":{"id":"826119a22834c382","repo":"jackwener/OpenCLI","slug":"instagram-private-mixed-media-publish-does-not-sup-826119","errorCode":null,"errorMessage":"Instagram private mixed-media publish does not support generating video covers on ${process.platform}","messagePattern":"Instagram private mixed-media publish does not support generating video covers on (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/instagram/_shared/private-publish.js","lineNumber":471,"sourceCode":"        throw new CommandExecutionError(`Instagram private publish failed to read video metadata for ${filePath}`);\n    }\n    return {\n        width: metadata.width,\n        height: metadata.height,\n        durationMs: metadata.durationMs,\n    };\n}\nfunction buildPrivateVideoCoverPath(filePath) {\n    const parsed = path.parse(filePath);\n    return path.join(os.tmpdir(), `opencli-instagram-private-video-cover-${parsed.name}-${crypto.randomUUID()}.jpg`);\n}\nfunction buildPrivateStoryVideoPath(filePath) {\n    const parsed = path.parse(filePath);\n    return path.join(os.tmpdir(), `opencli-instagram-story-video-${parsed.name}-${crypto.randomUUID()}${parsed.ext || '.mp4'}`);\n}\nfunction generateVideoCoverImage(filePath) {\n    if (process.platform !== 'darwin') {\n        throw new CommandExecutionError(`Instagram private mixed-media publish does not support generating video covers on ${process.platform}`, 'Use macOS for private mixed-media publishing, or rely on the UI fallback');\n    }\n    const outputPath = buildPrivateVideoCoverPath(filePath);\n    runSwiftJsonScript(`\nimport AVFoundation\nimport AppKit\nimport Foundation\n\nlet inputPath = CommandLine.arguments[1]\nlet outputPath = CommandLine.arguments[2]\nlet asset = AVURLAsset(url: URL(fileURLWithPath: inputPath))\nlet generator = AVAssetImageGenerator(asset: asset)\ngenerator.appliesPreferredTrackTransform = true\nlet image = try generator.copyCGImage(at: CMTime(seconds: 0, preferredTimescale: 600), actualTime: nil)\nlet rep = NSBitmapImageRep(cgImage: image)\nguard let data = rep.representation(using: .jpeg, properties: [.compressionFactor: 0.9]) else {\n  fputs(\"{\\\\\"error\\\\\":\\\\\"jpeg-encode-failed\\\\\"}\", stderr)\n  exit(1)\n}","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/instagram/_shared/private-publish.js#L453-L489","documentation":"generateVideoCoverImage extracts a cover frame using AVFoundation/AppKit through a Swift script, so it is macOS-only; on other platforms it throws at clis/instagram/_shared/private-publish.js:471. Like error 1911, this is a deliberate platform guard with the suggestion to use macOS or the UI fallback.","triggerScenarios":"Calling coverImage (via generateVideoCoverImage) while process.platform is 'linux' or 'win32'.","commonSituations":"Running the private video/story publisher on a Linux server or Windows workstation; CI runners without macOS hosts; Docker-based deployments of an automation that previously ran on a Mac.","solutions":["Run the cover generation and publish on macOS","Pre-generate the cover image yourself (e.g. `ffmpeg -i video.mp4 -frames:v 1 cover.jpg`) and pass it instead of letting the library derive it","Use the UI publish flow that has a fallback","Guard with a platform check and route to a different publish mode"],"exampleFix":"// before\nconst cover = await coverImage(videoPath);\n// after\nconst cover = process.platform === 'darwin'\n  ? await coverImage(videoPath)\n  : { cleanupPath: null, ...generateCoverWithFfmpeg(videoPath) };","handlingStrategy":"fallback","validationCode":"if (process.platform !== 'darwin') {\n  const { execSync } = require('child_process');\n  execSync(`ffmpeg -y -i ${videoPath} -frames:v 1 -q:v 2 ${coverPath}`);\n  return { cleanupPath: coverPath, bytes: fs.readFileSync(coverPath) };\n}","typeGuard":null,"tryCatchPattern":"let cover;\ntry { cover = await coverImage(videoPath); }\ncatch (e) {\n  if (/does not support generating video covers/.test(e.message)) cover = ffmpegCover(videoPath);\n  else throw e;\n}","preventionTips":["Check process.platform before entering the private video flow","Pre-generate covers with ffmpeg on non-mac hosts","Keep the UI fallback wired in for non-macOS deployments"],"tags":["platform","macos-only","video-cover"],"backgroundTag":"unsupported-platform","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}