{"record":{"id":"5b4de78daf7ba2b8","repo":"tonhowtf/omniget","slug":"youtube-requires-yt-dlp-failed-to-get-yt-dlp","errorCode":null,"errorMessage":"YouTube requires yt-dlp. Failed to get yt-dlp: {}","messagePattern":"YouTube requires yt-dlp\\. Failed to get yt-dlp: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/youtube.rs","lineNumber":273,"sourceCode":"\n    fn can_handle(&self, url: &str) -> bool {\n        if let Ok(parsed) = url::Url::parse(url) {\n            if let Some(host) = parsed.host_str() {\n                let host = host.to_lowercase();\n                return host == \"youtube.com\"\n                    || host.ends_with(\".youtube.com\")\n                    || host == \"youtu.be\"\n                    || host == \"youtube-nocookie.com\"\n                    || host.ends_with(\".youtube-nocookie.com\");\n            }\n        }\n        false\n    }\n\n    async fn get_media_info(&self, url: &str) -> anyhow::Result<MediaInfo> {\n        let ytdlp_path = ytdlp::ensure_ytdlp()\n            .await\n            .map_err(|e| anyhow!(\"YouTube requires yt-dlp. Failed to get yt-dlp: {}\", e))?;\n\n        Self::fetch_with_ytdlp(url, &ytdlp_path).await\n    }\n\n    async fn download(\n        &self,\n        info: &MediaInfo,\n        opts: &DownloadOptions,\n        progress: mpsc::Sender<ProgressUpdate>,\n    ) -> anyhow::Result<DownloadResult> {\n        let _ = progress.send(ProgressUpdate::percent(0.0)).await;\n\n        let ytdlp_path = if let Some(ref p) = opts.ytdlp_path {\n            p.clone()\n        } else {\n            ytdlp::ensure_ytdlp().await?\n        };\n","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/youtube.rs#L255-L291","documentation":"The YouTube platform implementation depends on the external yt-dlp binary. get_media_info calls ytdlp::ensure_ytdlp(), which is supposed to locate or download yt-dlp; when that fails (binary missing and auto-install failed), the platform cannot proceed and wraps the underlying error in this message.","triggerScenarios":"Calling get_media_info (or download, which shares the path) on any YouTube URL while ensure_ytdlp fails: no yt-dlp on PATH, download/install of yt-dlp failed (no network, blocked host, write-protected install dir), or the binary is present but not executable.","commonSituations":"Fresh machine or container without yt-dlp installed; sandboxed/offline environment where ensure_ytdlp cannot download; corrupted or outdated yt-dlp that YouTube rejects; antivirus or permissions blocking the downloaded binary.","solutions":["Install yt-dlp manually (pip install yt-dlp, or download from GitHub releases) and ensure it is on PATH.","Check network access and any proxy/firewall blocking the yt-dlp download host used by ensure_ytdlp.","Verify the yt-dlp binary is executable (chmod +x) and matches the platform architecture.","Upgrade to a recent yt-dlp version — YouTube frequently breaks older extractors.","Inspect the underlying error in the message body ('Failed to get yt-dlp: {}') for the actual cause."],"exampleFix":"// before\nlet info = youtube.get_media_info(url).await?; // fails: no yt-dlp\n\n// after\nif which::which(\"yt-dlp\").is_err() {\n    println!(\"installing yt-dlp first...\");\n}\nlet info = youtube.get_media_info(url).await?;","handlingStrategy":"fallback","validationCode":"// Rust\nif which::which(\"yt-dlp\").is_err() {\n    eprintln!(\"yt-dlp not found on PATH; ensure_ytdlp will attempt install\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install yt-dlp as part of environment setup (pip install yt-dlp or package manager)","Pin and regularly update yt-dlp — YouTube breaks old extractors frequently","Verify network/proxy access to the host ensure_ytdlp downloads from","Confirm the binary is executable and arch-matched after auto-install"],"tags":["youtube","yt-dlp","missing-dependency","external-binary"],"backgroundTag":"missing-dependency","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"}