tonhowtf/omniget · error
YouTube requer yt-dlp para funcionar. Falha ao obter yt-dlp
Error message
YouTube requer yt-dlp para funcionar. Falha ao obter yt-dlp: {} What it means
Thrown by YouTubeDownloader::get_media_info when ytdlp::ensure_ytdlp() fails — the yt-dlp binary is missing and could not be provisioned. YouTube extraction in this codebase depends on yt-dlp, so without it nothing can proceed. The underlying ensure_ytdlp error is embedded in the message.
Solutions
- Install yt-dlp and ensure it is on PATH (pip install yt-dlp or the official binary).
- Read the embedded cause ('Falha ao obter yt-dlp: {}') to identify download vs permission vs execution failure.
- Ensure network connectivity so the app can auto-download yt-dlp.
- Grant write permission to the directory where the app stores yt-dlp.
- Update yt-dlp regularly — YouTube breaks old versions frequently.
Example fix
// before
let ytdlp_path = ytdlp::ensure_ytdlp().await.map_err(|e| {
anyhow!("YouTube requer yt-dlp para funcionar. Falha ao obter yt-dlp: {}", e)
})?;
// after: prefer a user-configured binary
let ytdlp_path = match std::env::var_os("YTDLP_PATH") {
Some(p) => std::path::PathBuf::from(p),
None => ytdlp::ensure_ytdlp().await.map_err(|e| {
anyhow!("YouTube requer yt-dlp para funcionar. Falha ao obter yt-dlp: {}", e)
})?,
}; Defensive patterns
Strategy: validation
Validate before calling
// ensure yt-dlp is provisioned before any YouTube call
let ytdlp_path = match ytdlp::ensure_ytdlp().await {
Ok(p) => p,
Err(e) => { eprintln!("install yt-dlp first: {}", e); return; }
}; Type guard
fn ytdlp_ready(path: &std::path::Path) -> bool {
path.exists() && std::fs::metadata(path).map(|m| m.len() > 0).unwrap_or(false)
} Try / catch
match downloader.get_media_info(&youtube_url).await {
Err(e) if e.to_string().contains("requer yt-dlp") => {
// run first-time setup: download yt-dlp, verify PATH, then retry
run_ytdlp_setup_wizard().await?;
downloader.get_media_info(&youtube_url).await
}
other => other,
} Prevention
- Run a setup check at app startup that verifies yt-dlp presence.
- Keep the machine online for first-run auto-download of yt-dlp.
- Ensure the yt-dlp storage directory is writable.
- Update yt-dlp frequently — YouTube breaks old versions often.
- Allow users to point to a custom yt-dlp binary via config/env.
When it happens
Trigger: Calling get_media_info (or download) on a YouTube URL when ensure_ytdlp fails: binary not installed and not on PATH, auto-download fails due to no network or no write permission, or the binary is blocked by the OS.
Common situations: First run on a machine without yt-dlp while offline; sandboxed or read-only install directories; antivirus quarantine of the downloaded binary; corrupted yt-dlp installation.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
- Vimeo requer yt-dlp para funcionar. Falha ao obter yt-dlp
- o yt-dlp não está disponível
- Video extraction failed. Update yt-dlp or try again.
- Playlist empty or unavailable
- Download cancelled
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/f4531ce5950afa5c.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/src/platforms/youtube/mod.rs:272
}
fn can_handle(&self, url: &str) -> bool {
if let Ok(parsed) = url::Url::parse(url) {
if let Some(host) = parsed.host_str() {
let host = host.to_lowercase();
return host == "youtube.com"
|| host.ends_with(".youtube.com")
|| host == "youtu.be"
|| host == "youtube-nocookie.com"
|| host.ends_with(".youtube-nocookie.com");
}
}
false
}
async fn get_media_info(&self, url: &str) -> anyhow::Result<MediaInfo> {
let ytdlp_path = ytdlp::ensure_ytdlp().await.map_err(|e| {
anyhow!(
"YouTube requer yt-dlp para funcionar. Falha ao obter yt-dlp: {}",
e
)
})?;
if Self::is_playlist_url(url) {
let (playlist_title, entries) = ytdlp::get_playlist_info(&ytdlp_path, url, &[]).await?;
if entries.is_empty() {
return Err(anyhow!("Playlist empty or unavailable"));
}
let qualities: Vec<MediaVideoQuality> = entries
.into_iter()
.enumerate()
.map(|(i, entry)| MediaVideoQuality {
label: format!("{}. {}", i + 1, entry.title),
width: 0,View on GitHub (pinned to 8600b91f42)