tonhowtf/omniget · error

No video URL

Error message

No video URL

What it means

For MediaType::Video posts, native_download searches available_qualities for an entry with label == "video". If media info was built without such an entry, the download path cannot proceed and throws "No video URL".

Solutions

  1. Check parse_media to ensure every Video-typed MediaInfo always pushes a "video"-labelled quality entry.
  2. Re-fetch media info (native_get_media_info) in case the earlier fetch was incomplete.
  3. Inspect info.available_qualities at the failure point to see which labels were actually produced.
  4. Fall back to the post's fallback_url / HLS URL directly if the labelled entry is missing.

Example fix

// before
let video_quality = info.available_qualities.iter()
    .find(|q| q.label == "video")
    .ok_or_else(|| anyhow!("No video URL"))?;
// after: graceful fallback to first video-like entry
let video_quality = info.available_qualities.iter()
    .find(|q| q.label == "video")
    .or_else(|| info.available_qualities.first())
    .ok_or_else(|| anyhow!("No video URL"))?;
Defensive patterns

Strategy: type-guard

Validate before calling

// after getting MediaInfo, before download
fn has_video_entry(info: &MediaInfo) -> bool {
    info.media_type == MediaType::Video
        && info.available_qualities.iter().any(|q| q.label == "video")
}

Type guard

fn get_video_quality(info: &MediaInfo) -> Option<&Quality> {
    if info.media_type != MediaType::Video { return None; }
    info.available_qualities.iter().find(|q| q.label == "video")
}

Try / catch

match native_download(opts).await {
    Err(e) if e.to_string() == "No video URL" => {
        // media info inconsistent: refetch and retry once
        let fresh = get_media_info(url).await?;
        retry_download(fresh).await?;
    }
    other => other,
}

Prevention

When it happens

Trigger: native_download is called on MediaInfo whose media_type is Video but available_qualities contains no item labelled "video" — i.e. parse_media produced inconsistent state between media_type and qualities.

Common situations: Bug in parse_media that sets media_type without appending the video quality entry; partial/corrupt media JSON where DASH URLs are absent; race where media info came from a different code path.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/1646190fabba51fa. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/platforms/reddit.rs:544

                    file_size_bytes: None,
                })
            }
        }
    }

    async fn native_download(
        &self,
        info: &MediaInfo,
        opts: &DownloadOptions,
        progress: mpsc::Sender<ProgressUpdate>,
    ) -> anyhow::Result<DownloadResult> {
        match info.media_type {
            MediaType::Video => {
                let video_quality = info
                    .available_qualities
                    .iter()
                    .find(|q| q.label == "video")
                    .ok_or_else(|| anyhow!("No video URL"))?;

                let audio_quality = info.available_qualities.iter().find(|q| q.label == "audio");

                let has_audio = audio_quality.is_some();
                let ffmpeg_available = ffmpeg::is_ffmpeg_available().await;

                if has_audio && !ffmpeg_available {
                    tracing::warn!("[reddit] Video has separate audio but FFmpeg is not installed — downloading video without audio");
                }

                if has_audio {
                    let video_tmp = opts.output_dir.join(format!(
                        "{}_video_tmp.mp4",
                        sanitize_filename::sanitize(&info.title)
                    ));
                    let audio_tmp = opts.output_dir.join(format!(
                        "{}_audio_tmp.mp4",
                        sanitize_filename::sanitize(&info.title)

View on GitHub (pinned to 8600b91f42)