tonhowtf/omniget · error

o yt-dlp não está disponível

Error message

o yt-dlp não está disponível: {e}

What it means

Thrown by ytdlp_bin in vimeo.rs when crate::core::ytdlp::ensure_ytdlp() fails, i.e., the yt-dlp binary could not be located, downloaded, or verified. It wraps the underlying ensure error so callers see that Vimeo enumeration cannot proceed without the tool.

Solutions

  1. Install yt-dlp system-wide (`pip install -U yt-dlp` or the OS package) so ensure_ytdlp finds it on PATH.
  2. If the app self-installs yt-dlp, check network egress and the writability of its managed install directory.
  3. Run the same command as the same user the app runs as — per-user pip installs are often invisible to service accounts.
  4. Inspect the wrapped `{e}` message; it names the specific ensure step that failed (lookup vs download).

Example fix

// before: assume availability
let bin = ytdlp_bin().await?;
// after: pre-check with a clear operator message
if which::which("yt-dlp").is_err() {
    eprintln!("instale yt-dlp: pip install -U yt-dlp");
}
let bin = ytdlp_bin().await?;
Defensive patterns

Strategy: fallback

Validate before calling

match which::which("yt-dlp") {
    Ok(p) => Some(p),
    Err(_) => {
        eprintln!("yt-dlp ausente — instale com: pip install -U yt-dlp");
        None
    }
}

Try / catch

let bin = match ytdlp_bin().await {
    Ok(b) => b,
    Err(e) => {
        eprintln!("{e}; verifique a instalação do yt-dlp e o acesso à rede para download automático");
        return Err(e);
    }
};

Prevention

When it happens

Trigger: Any Vimeo listing/download entry point calling ytdlp_bin() when ensure_ytdlp cannot find yt-dlp on PATH and its managed-install/download path also fails (no network, no writable install dir, python missing for the source install).

Common situations: Fresh container without yt-dlp and egress blocked so auto-download fails; install directory not writable under the app sandbox; yt-dlp installed only for a different user; python3 absent for source-based installs.

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


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/19a550362a24017a. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/vimeo.rs:740

fn dir_listing(dest: &Path) -> Vec<(String, u64)> {
    let Ok(rd) = std::fs::read_dir(dest) else {
        return Vec::new();
    };
    rd.filter_map(|e| e.ok())
        .map(|e| {
            let name = e.file_name().to_string_lossy().to_string();
            let bytes = e.metadata().map(|m| m.len()).unwrap_or(0);
            (name, bytes)
        })
        .collect()
}

// ───────────────────────── execução ─────────────────────────

async fn ytdlp_bin() -> 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 o stdout inteiro. Usado só pela enumeração.
async fn run_json(bin: &Path, args: &[String], secrets: &[&str]) -> Result<String> {
    let _slot = crate::core::ytdlp::acquire_ytdlp_slot("vimeo-list").await;
    let mut cmd = crate::core::ytdlp::ytdlp_command(bin);
    cmd.args(args).stdin(std::process::Stdio::null());
    let out = cmd
        .output()
        .await
        .map_err(|e| anyhow!("não foi possível iniciar o yt-dlp: {e}"))?;
    if !out.status.success() {
        let tail = scrub(&String::from_utf8_lossy(&out.stderr), secrets);
        let msg = tail
            .lines()
            .rev()
            .find(|l| !l.trim().is_empty())
            .unwrap_or("")

View on GitHub (pinned to 8600b91f42)