{"record":{"id":"b21f8e9f9812f009","repo":"tonhowtf/omniget","slug":"o-gallery-dl-n-o-est-instalado-e-n-o-foi-poss-vel-baix-lo","errorCode":null,"errorMessage":"o gallery-dl não está instalado e não foi possível baixá-lo","messagePattern":"o gallery-dl não está instalado e não foi possível baixá-lo","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src-tauri/omniget-core/src/core/tools/tumblr/gdl.rs","lineNumber":233,"sourceCode":"        return Ok(None);\n    }\n    let dir = super::super::temp_dir();\n    std::fs::create_dir_all(&dir)?;\n    let path = dir.join(format!(\"gdl-cookies-{}.txt\", uuid::Uuid::new_v4()));\n    std::fs::write(&path, filtered)?;\n    Ok(Some(CookieFile { path }))\n}\n\n// ───────────────────────── processo ─────────────────────────\n\nfn range_arg(limit: Option<u64>) -> Option<String> {\n    limit.filter(|n| *n > 0).map(|n| format!(\"1-{}\", n))\n}\n\nasync fn binary() -> Result<PathBuf> {\n    crate::core::dependencies::ensure_gallerydl()\n        .await\n        .ok_or_else(|| anyhow!(\"o gallery-dl não está instalado e não foi possível baixá-lo\"))\n}\n\n/// `gallery-dl -j <url>`: só lista, não baixa nada.\npub async fn dump(\n    url: &str,\n    cookies: Option<&Path>,\n    limit: Option<u64>,\n    extra: &[String],\n    progress: &super::super::ProgressFn,\n    id: &str,\n) -> Result<Vec<Entry>> {\n    use tokio::io::AsyncReadExt;\n\n    let bin = binary().await?;\n    let mut cmd = crate::core::process::command(&bin);\n    cmd.arg(\"-j\");\n    if let Some(r) = range_arg(limit) {\n        cmd.args([\"--range\", &r]);","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/tumblr/gdl.rs#L215-L251","documentation":"The tumblr gdl module relies on an external gallery-dl binary. binary() calls ensure_gallerydl(), which tries to locate or download the tool; if it returns None, this error is thrown because nothing can proceed without the executable. It applies to both dump() (listing) and download() (fetching media).","triggerScenarios":"gallery-dl is not on PATH and the automatic download path failed (network error, unsupported platform, no writable install location), making ensure_gallerydl() return None before dump() or download() is called.","commonSituations":"Fresh machine without gallery-dl installed; offline environment blocks the auto-download; gallery-dl installed under a name not on PATH; Python runtime missing for the pip-installed variant; antivirus or permissions blocked the downloaded binary.","solutions":["Install gallery-dl manually (pip install gallery-dl or download the standalone binary) and put it on PATH","Check network connectivity so ensure_gallerydl() can download it automatically","Verify the install location used by ensure_gallerydl is writable and not blocked by antivirus","Confirm the binary runs (gallery-dl --version) from a shell"],"exampleFix":"// before\n// gallery-dl not installed, offline environment\nlet dump = gdl::dump(&url, cookies, limit).await?;\n// after\nmatch gdl::dump(&url, cookies, limit).await {\n    Ok(d) => d,\n    Err(e) if e.to_string().contains(\"gallery-dl\") => {\n        install_gallerydl().await?; // user-side remediation\n        gdl::dump(&url, cookies, limit).await?\n    }\n    Err(e) => return Err(e),\n}","handlingStrategy":"fallback","validationCode":"which gallery-dl >/dev/null 2>&1 || pip show gallery-dl >/dev/null 2>&1 || { echo 'instale o gallery-dl antes de usar'; exit 1; }","typeGuard":null,"tryCatchPattern":"match gdl::dump(&url, cookies, limit).await {\n    Ok(d) => d,\n    Err(e) if e.to_string().contains(\"não está instalado\") => {\n        eprintln!(\"Instale: pip install gallery-dl\");\n        std::process::exit(2);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Install gallery-dl as part of environment setup","Run gallery-dl --version in a preflight check at app startup","Ensure network access to the download mirror used by ensure_gallerydl"],"tags":["dependency","gallery-dl","installation","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"}