{"record":{"id":"19a550362a24017a","repo":"tonhowtf/omniget","slug":"o-yt-dlp-n-o-est-dispon-vel-e","errorCode":null,"errorMessage":"o yt-dlp não está disponível: {e}","messagePattern":"o yt-dlp não está disponível: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/vimeo.rs","lineNumber":740,"sourceCode":"fn dir_listing(dest: &Path) -> Vec<(String, u64)> {\n    let Ok(rd) = std::fs::read_dir(dest) else {\n        return Vec::new();\n    };\n    rd.filter_map(|e| e.ok())\n        .map(|e| {\n            let name = e.file_name().to_string_lossy().to_string();\n            let bytes = e.metadata().map(|m| m.len()).unwrap_or(0);\n            (name, bytes)\n        })\n        .collect()\n}\n\n// ───────────────────────── execução ─────────────────────────\n\nasync fn ytdlp_bin() -> Result<PathBuf> {\n    crate::core::ytdlp::ensure_ytdlp()\n        .await\n        .map_err(|e| anyhow!(\"o yt-dlp não está disponível: {e}\"))\n}\n\n/// Roda o yt-dlp e devolve o stdout inteiro. Usado só pela enumeração.\nasync fn run_json(bin: &Path, args: &[String], secrets: &[&str]) -> Result<String> {\n    let _slot = crate::core::ytdlp::acquire_ytdlp_slot(\"vimeo-list\").await;\n    let mut cmd = crate::core::ytdlp::ytdlp_command(bin);\n    cmd.args(args).stdin(std::process::Stdio::null());\n    let out = cmd\n        .output()\n        .await\n        .map_err(|e| anyhow!(\"não foi possível iniciar o yt-dlp: {e}\"))?;\n    if !out.status.success() {\n        let tail = scrub(&String::from_utf8_lossy(&out.stderr), secrets);\n        let msg = tail\n            .lines()\n            .rev()\n            .find(|l| !l.trim().is_empty())\n            .unwrap_or(\"\")","sourceCodeStart":722,"sourceCodeEnd":758,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/vimeo.rs#L722-L758","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Install yt-dlp system-wide (`pip install -U yt-dlp` or the OS package) so ensure_ytdlp finds it on PATH.","If the app self-installs yt-dlp, check network egress and the writability of its managed install directory.","Run the same command as the same user the app runs as — per-user pip installs are often invisible to service accounts.","Inspect the wrapped `{e}` message; it names the specific ensure step that failed (lookup vs download)."],"exampleFix":"// before: assume availability\nlet bin = ytdlp_bin().await?;\n// after: pre-check with a clear operator message\nif which::which(\"yt-dlp\").is_err() {\n    eprintln!(\"instale yt-dlp: pip install -U yt-dlp\");\n}\nlet bin = ytdlp_bin().await?;","handlingStrategy":"fallback","validationCode":"match which::which(\"yt-dlp\") {\n    Ok(p) => Some(p),\n    Err(_) => {\n        eprintln!(\"yt-dlp ausente — instale com: pip install -U yt-dlp\");\n        None\n    }\n}","typeGuard":null,"tryCatchPattern":"let bin = match ytdlp_bin().await {\n    Ok(b) => b,\n    Err(e) => {\n        eprintln!(\"{e}; verifique a instalação do yt-dlp e o acesso à rede para download automático\");\n        return Err(e);\n    }\n};","preventionTips":["Install yt-dlp in the image rather than relying on first-run auto-download","Ensure egress network access for the managed-install fallback","Run the app as a user that owns the pip/managed install locations","Add a startup dependency check that reports yt-dlp availability"],"tags":["yt-dlp","vimeo","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"}