{"record":{"id":"6fee38a31090f500","repo":"tonhowtf/omniget","slug":"no-resolution-available-mod","errorCode":null,"errorMessage":"No resolution available","messagePattern":"No resolution available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/reddit/mod.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/src/platforms/reddit/mod.rs#L195-L231","documentation":"download_video_with_fallback seeds its fallback loop with a sentinel error that is returned only when no resolution variant download ever succeeds. If get_resolution_variants returns nothing usable or every variant fails, the caller receives 'No resolution available' (or the last variant's error).","triggerScenarios":"Calling native_download for a Reddit video whose generated fallback candidate URLs (DASH playlist variants) are all invalid — typically because the video's fallback_url lacks the expected DASH base or Reddit removed/rotated the HLS/DASH assets.","commonSituations":"Reddit posts whose video was re-hosted/removed after publishing; fallback URLs with query parameters that break candidate construction; posts with video but no DASH renditions; expired CDN links for old posts.","solutions":["Log each variant URL and test it with curl to see whether all candidates 403/404.","Regenerate the video URL from fresh media info (do not cache URLs; Reddit CDN links expire).","Fix get_resolution_variants to always include the unmodified source URL as the last candidate.","Check that fallback_url query strings are stripped correctly before building DASH URLs (see construct_audio_url pattern).","Fall back to an external downloader (yt-dlp) when all internal variants fail."],"exampleFix":"// before\nlet variants = Self::get_resolution_variants(video_url);\nlet mut last_err = anyhow!(\"No resolution available\");\n// after\nlet mut variants = Self::get_resolution_variants(video_url);\nif variants.is_empty() {\n    variants.push(video_url.to_string()); // always keep the original URL as a last resort\n}\nlet mut last_err = anyhow!(\"No resolution variants generated for {}\", video_url);","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match download(url, out).await {\n    Err(e) if e.to_string().contains(\"No resolution available\") => {\n        // last-resort external downloader\n        yt_dlp::download(url, out).await\n    }\n    other => other,\n}","preventionTips":["Always keep the original video URL as the last variant candidate","Never cache Reddit CDN URLs — re-fetch media info before each download","Strip query strings from fallback URLs before building DASH candidates","Log each variant URL + HTTP status to diagnose why all candidates fail"],"tags":["reddit","download","fallback","video"],"backgroundTag":"http-request-failed","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"}