tonhowtf/omniget · error

Nenhum URL GIF

Error message

Nenhum URL GIF

What it means

For MediaType::Gif posts, native_download takes the first entry of available_qualities as the GIF URL; if the list is empty, it throws the Portuguese message "Nenhum URL GIF". parse_media classified the post as a GIF but produced no downloadable URL.

Solutions

  1. Dump the post's preview.images[0].variants JSON to see which gif variants actually exist.
  2. Extend parse_media to fall back to the static image URL when no gif variant is present.
  3. Re-fetch media info in case the first parse was against a truncated response.
  4. Notify the user the GIF is unavailable rather than surfacing a raw error.
Defensive patterns

Strategy: type-guard

Validate before calling

// before download, ensure a GIF URL exists
fn has_gif_entry(info: &MediaInfo) -> bool {
    info.media_type == MediaType::Gif
        && info.available_qualities.first().map(|q| !q.url.is_empty()).unwrap_or(false)
}

Type guard

fn gif_url(info: &MediaInfo) -> Option<&str> {
    if info.media_type != MediaType::Gif { return None; }
    info.available_qualities.first().map(|q| q.url.as_str()).filter(|u| !u.is_empty())
}

Try / catch

match native_download(opts).await {
    Err(e) if e.to_string() == "Nenhum URL GIF" => {
        show_user("GIF source unavailable for this post");
    }
    other => other,
}

Prevention

When it happens

Trigger: native_download runs on a post whose media_type is Gif but available_qualities is empty — typically when preview.images[0].variants.gif / mp4 sources were absent or unparseable during media-info extraction.

Common situations: Reddit preview JSON lacking the gif/mp4 variant (post previews as static image), giphy/imgur-hosted GIFs behind redirects, or Reddit changing the preview JSON layout.

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/d8b2e54602e30cb9. Report an issue: GitHub.

Appendix: source

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

                            &output,
                            progress,
                            Some(&opts.cancel_token),
                        )
                        .await?;

                    Ok(DownloadResult {
                        file_path: output,
                        file_size_bytes: bytes,
                        duration_seconds: info.duration_seconds.unwrap_or(0.0),
                        torrent_id: None,
                    })
                }
            }
            MediaType::Gif => {
                let url = &info
                    .available_qualities
                    .first()
                    .ok_or_else(|| anyhow!("Nenhum URL GIF"))?
                    .url;
                let output = opts
                    .output_dir
                    .join(format!("{}.gif", sanitize_filename::sanitize(&info.title)));
                let bytes = direct_downloader::download_direct(
                    &self.client,
                    url,
                    &output,
                    progress,
                    Some(&opts.cancel_token),
                )
                .await?;

                Ok(DownloadResult {
                    file_path: output,
                    file_size_bytes: bytes,
                    duration_seconds: 0.0,
                    torrent_id: None,

View on GitHub (pinned to 8600b91f42)