{"record":{"id":"bcab8163886403a4","repo":"tonhowtf/omniget","slug":"o-yt-dlp-n-o-est-instalado","errorCode":null,"errorMessage":"o yt-dlp não está instalado","messagePattern":"o yt-dlp não está instalado","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/yt_archive.rs","lineNumber":57,"sourceCode":"        if let Some(p) = &self.path {\n            args.push(\"--cookies\".to_string());\n            args.push(p.to_string_lossy().to_string());\n        }\n    }\n}\n\nimpl Drop for CookieFile {\n    fn drop(&mut self) {\n        if let Some(p) = &self.path {\n            let _ = std::fs::remove_file(p);\n        }\n    }\n}\n\nasync fn ytdlp_path() -> anyhow::Result<PathBuf> {\n    crate::core::dependencies::find_tool(\"yt-dlp\")\n        .await\n        .ok_or_else(|| anyhow!(\"o yt-dlp não está instalado\"))\n}\n\n/// Roda o yt-dlp e devolve a saída padrão. Erro traz o fim do stderr.\npub async fn run_ytdlp(args: &[String]) -> anyhow::Result<String> {\n    let bin = ytdlp_path().await?;\n    let out = crate::core::ytdlp::ytdlp_command(&bin)\n        .args(args)\n        .stdin(std::process::Stdio::null())\n        .output()\n        .await\n        .map_err(|e| anyhow!(\"o yt-dlp não iniciou: {}\", e))?;\n    if !out.status.success() {\n        let err = String::from_utf8_lossy(&out.stderr);\n        let tail: Vec<&str> = err.lines().rev().take(3).collect();\n        return Err(anyhow!(\n            \"yt-dlp falhou: {}\",\n            tail.into_iter().rev().collect::<Vec<_>>().join(\" / \")\n        ));","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/yt_archive.rs#L39-L75","documentation":"ytdlp_path resolves the yt-dlp executable via find_tool(\"yt-dlp\"). If the tool is not found anywhere it searches, it throws \"o yt-dlp não está instalado\". yt-dlp is an external binary dependency, so the archive feature cannot run without it.","triggerScenarios":"Calling run_ytdlp or run when yt-dlp is not on PATH and not installed in the app's managed tools directory.","commonSituations":"Fresh install where the in-app dependency downloader was never run; yt-dlp removed from PATH; using a venv/container without the binary; yt-dlp installed under a different name (e.g. youtube-dl).","solutions":["Install yt-dlp (pip install yt-dlp, brew install yt-dlp, or the app's built-in dependency installer).","Ensure the yt-dlp binary's directory is on PATH and the binary is named exactly \"yt-dlp\".","Verify with `yt-dlp --version` in a terminal that it resolves.","If bundled, re-run the app's dependency download step so find_tool locates it."],"exampleFix":"// before\nlet out = run_ytdlp(&args).await?;\n// after\nif crate::core::dependencies::find_tool(\"yt-dlp\").await.is_none() {\n    eprintln!(\"instale o yt-dlp primeiro (pip install yt-dlp)\");\n    return Ok(());\n}\nlet out = run_ytdlp(&args).await?;","handlingStrategy":"validation","validationCode":"// Rust\nlet installed = crate::core::dependencies::find_tool(\"yt-dlp\").await.is_some();\nif !installed {\n    eprintln!(\"instale o yt-dlp antes de usar o arquivo (pip install yt-dlp)\");\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"match yt_archive::run(&opts, &progress).await {\n    Ok(r) => use(r),\n    Err(e) if e.to_string().contains(\"não está instalado\") => {\n        eprintln!(\"instale yt-dlp: pip install yt-dlp\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Run the app's dependency check/installer on startup","Ensure yt-dlp is on PATH and named exactly \"yt-dlp\"","Verify with `yt-dlp --version` in deployment scripts","Bundle or auto-download yt-dlp as part of installation"],"tags":["external-dependency","yt-dlp","cli"],"backgroundTag":"missing-dependency","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}