{"record":{"id":"1fd4b99eec67c342","repo":"jackwener/OpenCLI","slug":"instagram-private-mixed-media-publish-does-not-sup","errorCode":null,"errorMessage":"Instagram private mixed-media publish does not support reading video metadata on ${process.platform}","messagePattern":"Instagram private mixed-media publish does not support reading video metadata on (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/instagram/_shared/private-publish.js","lineNumber":427,"sourceCode":"                .map((value) => String(value || '').trim())\n                .filter(Boolean)\n                .join(' ');\n            throw new CommandExecutionError(`Instagram private publish failed to ${stage}`, detail || 'swift helper failed');\n        }\n        return JSON.parse(String(result.stdout || '{}'));\n    }\n    catch (error) {\n        if (error instanceof CommandExecutionError)\n            throw error;\n        throw new CommandExecutionError(`Instagram private publish failed to ${stage}`, error instanceof Error ? error.message : String(error));\n    }\n    finally {\n        fs.rmSync(scriptPath, { force: true });\n    }\n}\nfunction readVideoMetadata(filePath) {\n    if (process.platform !== 'darwin') {\n        throw new CommandExecutionError(`Instagram private mixed-media publish does not support reading video metadata on ${process.platform}`, 'Use macOS for private mixed-media publishing, or rely on the UI fallback');\n    }\n    const metadata = runSwiftJsonScript(`\nimport AVFoundation\nimport Foundation\n\nlet path = CommandLine.arguments[1]\nlet url = URL(fileURLWithPath: path)\nlet asset = AVURLAsset(url: url)\nguard let track = asset.tracks(withMediaType: .video).first else {\n  fputs(\"{\\\\\"error\\\\\":\\\\\"missing-video-track\\\\\"}\", stderr)\n  exit(1)\n}\nlet transformed = track.naturalSize.applying(track.preferredTransform)\nlet width = Int(abs(transformed.width.rounded()))\nlet height = Int(abs(transformed.height.rounded()))\nlet durationMs = Int((CMTimeGetSeconds(asset.duration) * 1000.0).rounded())\nlet payload: [String: Int] = [\n  \"width\": width,","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/instagram/_shared/private-publish.js#L409-L445","documentation":"readVideoMetadata uses AVFoundation via an inline Swift script, so it only works on macOS (darwin). On any other platform the function throws immediately at clis/instagram/_shared/private-publish.js:427, telling you to use macOS or the UI fallback. This is an explicit platform guard, not a runtime fault.","triggerScenarios":"Calling metadata (via readVideoMetadata) for a private mixed-media publish while process.platform is 'linux' or 'win32'.","commonSituations":"CI pipelines running the private publisher on Linux Docker images; developers on Windows trying to publish mixed photo/video carousels privately; switching machines/containers after developing on a Mac.","solutions":["Run the private mixed-media publish on a macOS machine","Use the UI-based publish flow which has a non-Swift fallback for video metadata","Short-circuit in your own code: check process.platform === 'darwin' before invoking the private publisher"],"exampleFix":"// before\nconst meta = await metadata(filePath);\n// after\nif (process.platform !== 'darwin') throw new Error('Private mixed-media publish requires macOS');\nconst meta = await metadata(filePath);","handlingStrategy":"validation","validationCode":"if (process.platform !== 'darwin') {\n  throw new Error('Private mixed-media publish requires macOS for video metadata');\n}","typeGuard":"const isMac = () => process.platform === 'darwin';","tryCatchPattern":"try { const meta = await metadata(videoPath); }\ncatch (e) {\n  if (/does not support reading video metadata/.test(e.message)) return useUiFallback();\n  throw e;\n}","preventionTips":["Gate the whole private mixed-media flow behind a darwin platform check","Document the macOS requirement for the private publisher in your tooling","Offer a UI or ffmpeg-based fallback for non-mac hosts"],"tags":["platform","macos-only","video-metadata"],"backgroundTag":"unsupported-platform","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}