{"record":{"id":"965ced214769445d","repo":"tonhowtf/omniget","slug":"download-failed-without-specific-error","errorCode":null,"errorMessage":"download failed without specific error","messagePattern":"download failed without specific error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/generic_ytdlp.rs","lineNumber":521,"sourceCode":"                        || msg.contains(\"no video formats\")\n                        || msg.contains(\"no suitable format\");\n                    let has_more = idx + 1 < format_fallbacks.len();\n                    if is_format_error && has_more && !opts.cancel_token.is_cancelled() {\n                        tracing::warn!(\n                            \"[generic_ytdlp] format fallback {}/{} after error: {}\",\n                            idx + 1,\n                            format_fallbacks.len() - 1,\n                            e\n                        );\n                        last_err = Some(e);\n                        continue;\n                    }\n                    return Err(e);\n                }\n            }\n        }\n\n        Err(last_err.unwrap_or_else(|| anyhow!(\"download failed without specific error\")))\n    }\n}\n\n/// Build the Referer for a raw HLS download, in priority order:\n/// explicit referer from options → the page URL the stream was found on →\n/// a known per-platform referer → the m3u8 URL's own origin.\n/// Returns an empty string only for unparseable URLs, in which case the\n/// downloader sends no Referer header at all.\nfn build_hls_referer(\n    explicit_referer: Option<&str>,\n    page_url: Option<&str>,\n    m3u8_url: &str,\n) -> String {\n    if let Some(r) = explicit_referer.map(str::trim).filter(|r| !r.is_empty()) {\n        return r.to_string();\n    }\n    if let Some(p) = page_url.map(str::trim).filter(|p| !p.is_empty()) {\n        return p.to_string();","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/generic_ytdlp.rs#L503-L539","documentation":"download retries the yt-dlp/ffmpeg pipeline across fallback strategies, keeping the last error in last_err. If the loop exits with last_err == None — meaning no attempt was even recorded (strategy list empty or unreachable state) — this placeholder error is returned, since there is no underlying failure message to surface.","triggerScenarios":"The retry/fallback loop in download terminates with Err(last_err.unwrap_or_else(...)) while last_err is None: no iteration produced an error, e.g. the fallback strategy list was empty or the loop body never executed.","commonSituations":"A configuration path that filters out every download strategy (e.g. HLS-only handling removed); internal refactor leaving the loop with zero attempts; caller passing options that disable all candidate strategies.","solutions":["Inspect the download options that reach this loop and confirm at least one strategy is applicable.","Add logging before the loop to record how many strategies were attempted; zero attempts points to an internal invariant bug — file an issue upstream.","If it only appears after upgrading the library, check the changelog for changes to the strategy/fallback list and pin the previous version."],"exampleFix":"// before\nErr(last_err.unwrap_or_else(|| anyhow!(\"download failed without specific error\")))\n// after\nErr(last_err.unwrap_or_else(|| {\n    anyhow!(\"download failed without specific error (0 strategies attempted — check opts/strategy selection)\")\n}))","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match platform.download(opts).await {\n    Err(e) if e.to_string().contains(\"without specific error\") => {\n        eprintln!(\"internal: no download strategy was attempted; dump opts and report upstream\");\n        Err(anyhow!(\"download aborted before any attempt: {opts:?}\"))\n    }\n    other => other,\n}","preventionTips":["Don't pass download options that could filter out every strategy.","Treat this error as a library bug — enable debug logging and file an issue with the options used.","Pin library versions and review changelogs for strategy-selection changes."],"tags":["retry-loop","invariant","rust","download"],"backgroundTag":"internal-invariant-violation","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"}