{"record":{"id":"acdb306db773af72","repo":"tonhowtf/omniget","slug":"no-resolution-available","errorCode":null,"errorMessage":"No resolution available","messagePattern":"No resolution available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/reddit.rs","lineNumber":213,"sourceCode":"                if let Some(base) = video_url.rfind(\"DASH_\") {\n                    let mut variant = video_url[..base].to_string();\n                    variant.push_str(res);\n                    variants.push(variant);\n                }\n            }\n        }\n        variants\n    }\n\n    async fn download_video_with_fallback(\n        &self,\n        video_url: &str,\n        output: &std::path::Path,\n        progress_tx: mpsc::Sender<ProgressUpdate>,\n        cancel: Option<&tokio_util::sync::CancellationToken>,\n    ) -> anyhow::Result<u64> {\n        let variants = Self::get_resolution_variants(video_url);\n        let mut last_err = anyhow!(\"No resolution available\");\n\n        for variant in &variants {\n            if let Some(token) = cancel {\n                if token.is_cancelled() {\n                    return Err(anyhow!(\"Download cancelled\"));\n                }\n            }\n            match direct_downloader::download_direct(\n                &self.client,\n                variant,\n                output,\n                progress_tx.clone(),\n                cancel,\n            )\n            .await\n            {\n                Ok(bytes) => return Ok(bytes),\n                Err(e) => {","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/reddit.rs#L195-L231","documentation":"download_video_with_fallback initializes last_err with this sentinel before iterating resolution variants (produced by get_resolution_variants). If the variants list is empty, or every variant download fails, the sentinel (or the last variant error) is returned — meaning no usable video resolution URL was found.","triggerScenarios":"native_download calls download_video_with_fallback with a video_url from which get_resolution_variants derives zero candidates, or all variant downloads fail with network/HTTP errors.","commonSituations":"DASH video URLs where fallback derivation fails, Reddit CDN blocking downloads (403), expired signed URLs, or posts whose video URL lacks the expected DASHPlaylist.mpd / DASH_ pattern.","solutions":["Print the variants list derived from the video URL to confirm get_resolution_variants found candidates.","Verify the video URL is still valid (Reddit DASH URLs can expire); re-fetch media info and retry.","Check network access to v.redd.it / reddit media CDN hosts and any proxy/firewall interference.","Inspect the wrapped last_err chain for the underlying per-variant failure (HTTP status, timeout)."],"exampleFix":"// before\nlet mut last_err = anyhow!(\"No resolution available\");\n// after: include the URL and variant count for diagnosability\nlet variants = Self::get_resolution_variants(video_url);\nif variants.is_empty() {\n    return Err(anyhow!(\"No resolution variants derived from {}\", video_url));\n}\nlet mut last_err = anyhow!(\"No resolution available for {} ({} variants)\", video_url, variants.len());","handlingStrategy":"fallback","validationCode":"// ensure the URL has a DASH/video shape before download\nif !video_url.contains(\"DASH\") && !video_url.contains(\"v.redd.it\") {\n    eprintln!(\"Suspicious video URL, few/no variants expected: {}\", video_url);\n}","typeGuard":null,"tryCatchPattern":"match native_download(opts).await {\n    Err(e) if e.to_string().contains(\"No resolution available\") => {\n        eprintln!(\"All variants failed: {}\", e.source().map(|s| s.to_string()).unwrap_or_default());\n        refresh_media_info_and_retry_once();\n    }\n    other => other,\n}","preventionTips":["Refresh media info shortly before downloading — Reddit DASH URLs expire.","Log the derived variant list to catch parser regressions in get_resolution_variants.","Ensure outbound network access to v.redd.it and reddit media hosts.","Inspect error chains to surface the underlying per-variant HTTP failure."],"tags":["download","fallback","reddit","video"],"backgroundTag":"empty-result-set","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"}