jackwener/OpenCLI · error · ArgumentError

Video jobs support video-raw, video-social, or gif downloads

Error message

Video jobs support video-raw, video-social, or gif downloads

What it means

This ArgumentError is thrown when --kind image is requested for a job that isVideoJob(job) identifies as a video job. Video jobs only expose video-raw, video-social, or gif downloads (auto also resolves to video-raw), so requesting a still image for a video job is rejected.

Source

Thrown at clis/midjourney/download.js:49

    { name: 'job', positional: true, required: true, help: 'Job UUID or Midjourney /jobs/<uuid> URL' },
    { name: 'index', default: 'all', help: 'Candidate 1..4 or all' },
    { name: 'kind', default: 'auto', help: 'auto, image, video-raw, video-social, or gif' },
    { name: 'output', default: '~/Pictures/Midjourney', help: 'Output directory' },
    { name: 'force', type: 'boolean', default: false, help: 'Overwrite existing non-empty files' },
  ],
  columns: ['job_id', 'status', 'kind', 'index', 'file', 'bytes', 'mime', 'url'],
  func: async (page, kwargs) => {
    const jobId = parseJobId(kwargs.job);
    const job = await fetchJobStatus(page, jobId);
    const status = String(job.current_status || job.status || '').toLowerCase();
    if (status !== 'completed') {
      throw new CommandExecutionError(`Midjourney job ${jobId} is "${status || 'missing'}"; media is available after completion.`);
    }
    const video = isVideoJob(job);
    let kind = String(kwargs.kind || 'auto').trim().toLowerCase();
    if (!KINDS.includes(kind)) throw new ArgumentError(`--kind must be one of: ${KINDS.join(', ')}`);
    if (kind === 'auto') kind = video ? 'video-raw' : 'image';
    if (video && kind === 'image') throw new ArgumentError('Video jobs support video-raw, video-social, or gif downloads');
    if (!video && kind !== 'image') throw new ArgumentError('Image jobs only support --kind image');

    const indices = parseImageIndices(kwargs.index, Number(job.batch_size || (video ? 1 : 4)));
    const outputDir = resolveOutputDir(kwargs.output);
    const force = normalizeBoolean(kwargs.force);
    let files;
    if (kind === 'image') {
      files = (await downloadOriginals(page, jobId, indices, outputDir, force)).map((item) => ({
        ...item,
        kind: 'image',
      }));
    } else if (kind === 'video-raw') {
      files = [];
      for (const index of indices) files.push(await downloadRawVideo(page, jobId, index, outputDir, force));
    } else {
      files = [];
      for (const index of indices) files.push(await downloadRenderedVideo(page, jobId, index, kind, outputDir, force));
    }

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Drop --kind (or use --kind auto) so video jobs automatically download as video-raw
  2. Use --kind video-raw for the original video, --kind video-social for the social MP4, or --kind gif for an animated GIF
  3. Check the job type first (isVideoJob / job details) before choosing --kind
  4. Separate image and video job IDs into different download batches in scripts

Example fix

// before
opencli midjourney download abc123 --kind image
// after
opencli midjourney download abc123 --kind video-raw
Defensive patterns

Strategy: type-guard

Validate before calling

// Resolve job type before choosing --kind
const job = await fetchJobStatus(page, parseJobId(jobRef));
const video = isVideoJob(job);
const requested = String(kind || 'auto').trim().toLowerCase();
if (video && (requested === 'image')) {
  throw new Error('Job is a video; use video-raw, video-social, or gif.');
}
if (!video && requested !== 'auto' && requested !== 'image') {
  throw new Error('Job is an image; only --kind image is supported.');
}

Type guard

function isVideoJobType(job) {
  return isVideoJob(job);
}
// usage: const kind = isVideoJobType(job) ? 'video-raw' : 'image';

Try / catch

try {
  await run('midjourney', 'download', jobId, ['--kind', kind]);
} catch (err) {
  if (err.message.includes('Video jobs support')) {
    // retry with --kind auto or video-raw
  } else throw err;
}

Prevention

When it happens

Trigger: Calling `opencli midjourney download <job> --kind image` where the fetched job matches isVideoJob — i.e. the job was created by a video generation (e.g. an animated/zoom job), not a 4-image grid.

Common situations: Hardcoding --kind image in a script that also processes video jobs; assuming every Midjourney job produces stills; reusing an image-download command against a video job ID; --kind auto resolving unexpectedly and then being manually overridden to image.

Related errors


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