{"record":{"id":"4efbaa5189f39ac1","repo":"tonhowtf/omniget","slug":"aria2c-nao-esta-instalado-linux-macos-instale-pelo","errorCode":null,"errorMessage":"aria2c nao esta instalado (Linux/macOS: instale pelo gerenciador de pacotes)","messagePattern":"aria2c nao esta instalado \\(Linux/macOS: instale pelo gerenciador de pacotes\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/aria2.rs","lineNumber":67,"sourceCode":"    }\n}\n\n/// `[#a1b2c3 12MiB/100MiB(12%) CN:16 DL:5.0MiB ETA:10s]`\npub fn parse_progress(line: &str) -> Option<(u64, String)> {\n    let re = regex::Regex::new(r\"\\((\\d+)%\\).*?DL:([^\\s\\]]+)\").ok()?;\n    let c = re.captures(line)?;\n    Some((c[1].parse().ok()?, c[2].to_string()))\n}\n\npub async fn download(\n    opts: Aria2Options,\n    progress: super::ProgressFn,\n) -> anyhow::Result<Aria2Result> {\n    use tokio::io::{AsyncBufReadExt, BufReader};\n    let bin = crate::core::dependencies::ensure_aria2c()\n        .await\n        .ok_or_else(|| {\n            anyhow!(\"aria2c nao esta instalado (Linux/macOS: instale pelo gerenciador de pacotes)\")\n        })?;\n    std::fs::create_dir_all(&opts.dest_dir)?;\n    let conns = opts.connections.clamp(1, 16).to_string();\n    let mut cmd = crate::core::process::command(&bin);\n    cmd.args([\n        \"--dir\",\n        &opts.dest_dir,\n        \"-x\",\n        &conns,\n        \"-s\",\n        &conns,\n        \"-k\",\n        \"1M\",\n        \"--continue=true\",\n        \"--auto-file-renaming=false\",\n        \"--allow-overwrite=true\",\n        \"--summary-interval=1\",\n        \"--console-log-level=warn\",","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/aria2.rs#L49-L85","documentation":"The aria2 download() driver first calls ensure_aria2c() to locate the aria2c binary; if it returns None (binary not found and could not be provisioned) download() fails with this message indicating aria2c is not installed and should be installed via the system package manager on Linux/macOS. It is a pre-flight dependency check, thrown before any download starts.","triggerScenarios":"Calling download(opts, progress) on a system where aria2c is absent from PATH and the bundled/auto-install step (ensure_aria2c) failed or was skipped.","commonSituations":"Fresh Linux/macOS installs without aria2; minimal containers/Docker images lacking the binary; PATH not including the install location (e.g. Homebrew on Apple Silicon: /opt/homebrew/bin); Windows users without the aria2 exe in scope.","solutions":["Install aria2 via the package manager: sudo apt install aria2 (Debian/Ubuntu), brew install aria2 (macOS), dnf install aria2 (Fedora).","Verify with `which aria2c` that the binary is on PATH for the app's environment (GUI apps may not inherit shell PATH).","If the app can auto-download the binary, check disk space/permissions that may make ensure_aria2c() return None, then retry.","Alternatively switch the download to the non-aria2 HTTP engine if the app offers one."],"exampleFix":"// before\n$ omniget download <url>   // fails: aria2c not found\n// after\n$ brew install aria2       # or: sudo apt install aria2\n$ which aria2c             # /opt/homebrew/bin/aria2c\n$ omniget download <url>   # works","handlingStrategy":"fallback","validationCode":"// probe for aria2c before starting a download\nif which::which(\"aria2c\").is_err() {\n    eprintln!(\"aria2c missing — install with 'apt install aria2' or 'brew install aria2'\");\n    // fall back to the plain HTTP engine if available\n}","typeGuard":"fn aria2_available() -> bool { which::which(\"aria2c\").is_ok() }","tryCatchPattern":"match download(&opts, progress).await {\n    Ok(res) => report(res),\n    Err(e) if e.to_string().contains(\"aria2c nao esta instalado\") => {\n        eprintln!(\"install aria2 (apt/brew/dnf) or switch to the built-in HTTP downloader\");\n        fallback_http_download(&opts).await?;\n    }\n    Err(e) => show_error(e),\n}","preventionTips":["Install aria2 as part of app setup (apt install aria2 / brew install aria2)","Verify `which aria2c` in the same environment the app runs in (GUI apps may have a different PATH)","In containers, add aria2 to the Dockerfile","Offer a non-aria2 fallback download path in the app"],"tags":["missing-dependency","aria2","installation"],"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"}