{"record":{"id":"d8b2e54602e30cb9","repo":"tonhowtf/omniget","slug":"nenhum-url-gif","errorCode":null,"errorMessage":"Nenhum URL GIF","messagePattern":"Nenhum URL GIF","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/reddit.rs","lineNumber":681,"sourceCode":"                            &output,\n                            progress,\n                            Some(&opts.cancel_token),\n                        )\n                        .await?;\n\n                    Ok(DownloadResult {\n                        file_path: output,\n                        file_size_bytes: bytes,\n                        duration_seconds: info.duration_seconds.unwrap_or(0.0),\n                        torrent_id: None,\n                    })\n                }\n            }\n            MediaType::Gif => {\n                let url = &info\n                    .available_qualities\n                    .first()\n                    .ok_or_else(|| anyhow!(\"Nenhum URL GIF\"))?\n                    .url;\n                let output = opts\n                    .output_dir\n                    .join(format!(\"{}.gif\", sanitize_filename::sanitize(&info.title)));\n                let bytes = direct_downloader::download_direct(\n                    &self.client,\n                    url,\n                    &output,\n                    progress,\n                    Some(&opts.cancel_token),\n                )\n                .await?;\n\n                Ok(DownloadResult {\n                    file_path: output,\n                    file_size_bytes: bytes,\n                    duration_seconds: 0.0,\n                    torrent_id: None,","sourceCodeStart":663,"sourceCodeEnd":699,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/reddit.rs#L663-L699","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Dump the post's preview.images[0].variants JSON to see which gif variants actually exist.","Extend parse_media to fall back to the static image URL when no gif variant is present.","Re-fetch media info in case the first parse was against a truncated response.","Notify the user the GIF is unavailable rather than surfacing a raw error."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// before download, ensure a GIF URL exists\nfn has_gif_entry(info: &MediaInfo) -> bool {\n    info.media_type == MediaType::Gif\n        && info.available_qualities.first().map(|q| !q.url.is_empty()).unwrap_or(false)\n}","typeGuard":"fn gif_url(info: &MediaInfo) -> Option<&str> {\n    if info.media_type != MediaType::Gif { return None; }\n    info.available_qualities.first().map(|q| q.url.as_str()).filter(|u| !u.is_empty())\n}","tryCatchPattern":"match native_download(opts).await {\n    Err(e) if e.to_string() == \"Nenhum URL GIF\" => {\n        show_user(\"GIF source unavailable for this post\");\n    }\n    other => other,\n}","preventionTips":["Check the post's preview JSON has gif/mp4 variants before classifying as Gif.","Fall back to the static preview image when no gif variant exists.","Re-fetch media info if the first parse may have hit a truncated response.","Skip posts lacking gif variants in batch jobs instead of failing the whole batch."],"tags":["reddit","gif","download","media"],"backgroundTag":"resource-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}