tonhowtf/omniget · error · anyhow::Error
o yt-dlp não está disponível
Error message
o yt-dlp não está disponível: {} What it means
`ytdlp_binary` wraps `crate::core::ytdlp::ensure_ytdlp()`, which locates or installs the external yt-dlp executable. When that fails (binary absent, download of it failed, no network, unsupported platform), the error is re-wrapped with "o yt-dlp não está disponível". It signals that the TikTok tooling cannot proceed without the external dependency.
Solutions
- Install yt-dlp (pip install yt-dlp, package manager, or download the standalone binary) and ensure it is on PATH.
- Run the app once with network access so ensure_ytdlp can fetch the binary into its cache.
- Check the inner error `e` in the message for the precise provisioning failure (network, permissions, Python missing).
- Bundle yt-dlp with the app or point the ytdlp config at an explicit binary path.
Example fix
// before (CI failing because yt-dlp is absent) - run: cargo test // after - run: pip install yt-dlp - run: cargo test
Defensive patterns
Strategy: fallback
Validate before calling
// Pre-flight check before calling run_ytdlp/ytdlp_json
let ok = tokio::process::Command::new("yt-dlp").arg("--version").output().await.map(|o| o.status.success()).unwrap_or(false); Try / catch
match ytdlp_binary().await {
Ok(path) => run_download(&path).await,
Err(e) => show_install_instructions(&e), // "install yt-dlp / check network"
} Prevention
- Install yt-dlp and keep it updated (`pip install -U yt-dlp`).
- In packaged apps, bundle yt-dlp instead of relying on PATH.
- Run a --version preflight at app startup and surface a clear setup screen if missing.
When it happens
Trigger: Calling `run_ytdlp` or `ytdlp_json` when yt-dlp is not on PATH and ensure_ytdlp cannot provision it; ensure_ytdlp's install step fails due to network loss or a missing Python runtime; PATH is stripped in the spawned environment.
Common situations: Fresh machine or CI container without yt-dlp installed; user deleted the cached binary; corporate proxy blocks the download of yt-dlp; packaged app ships without bundling yt-dlp.
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
- o gallery-dl não está instalado e não foi possível baixá-lo
- Failed to start yt-dlp
- Vimeo requer yt-dlp para funcionar. Falha ao obter yt-dlp
- YouTube requer yt-dlp para funcionar. Falha ao obter yt-dlp
- yt-dlp not found in PATH or app data dir
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/9dc8100a21c42080.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/tiktok/mod.rs:670
let line = line
.trim_start_matches("ERROR:")
.trim_start_matches("WARNING:")
.trim();
let line = match line.split_once("] ") {
Some((head, rest)) if head.starts_with('[') => rest,
_ => line,
};
let mut s: String = line.chars().take(220).collect();
if s.is_empty() {
s = "o yt-dlp não baixou nada".to_string();
}
s
}
async fn ytdlp_binary() -> Result<PathBuf> {
crate::core::ytdlp::ensure_ytdlp()
.await
.map_err(|e| anyhow!("o yt-dlp não está disponível: {}", e))
}
/// Roda o yt-dlp e devolve (arquivos criados, últimas linhas de erro).
pub async fn run_ytdlp(
args: &[String],
id: &str,
progress: &ProgressFn,
) -> Result<(Vec<String>, String)> {
use tokio::io::{AsyncBufReadExt, BufReader};
let bin = ytdlp_binary().await?;
let mut cmd = crate::core::ytdlp::ytdlp_command(&bin);
cmd.args(args)
.stdin(std::process::Stdio::null())
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped());
let mut child = cmd
.spawn()
.map_err(|e| anyhow!("não foi possível iniciar o yt-dlp: {}", e))?;View on GitHub (pinned to 8600b91f42)