{"record":{"id":"e065c67e60c13927","repo":"tonhowtf/omniget","slug":"gallery-dl-nao-tem-binario-para-este-sistema","errorCode":null,"errorMessage":"gallery-dl nao tem binario para este sistema","messagePattern":"gallery-dl nao tem binario para este sistema","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/dependencies.rs","lineNumber":823,"sourceCode":"    None\n}\n\nasync fn download_gallerydl() -> anyhow::Result<PathBuf> {\n    let bin_dir = managed_bin_dir().ok_or_else(|| anyhow!(\"Could not determine data directory\"))?;\n    std::fs::create_dir_all(&bin_dir)?;\n\n    let target = bin_dir.join(bin_name(\"gallery-dl\"));\n\n    // Os executaveis standalone vivem no repo gdl-org/builds (Windows, Linux\n    // e macOS); o release do mikf/gallery-dl nao publica mais assets.\n    #[cfg(target_os = \"windows\")]\n    let url = \"https://github.com/gdl-org/builds/releases/latest/download/gallery-dl_windows.exe\";\n    #[cfg(target_os = \"linux\")]\n    let url = \"https://github.com/gdl-org/builds/releases/latest/download/gallery-dl_linux\";\n    #[cfg(target_os = \"macos\")]\n    let url = \"https://github.com/gdl-org/builds/releases/latest/download/gallery-dl_macos\";\n    #[cfg(not(any(target_os = \"windows\", target_os = \"linux\", target_os = \"macos\")))]\n    return Err(anyhow!(\"gallery-dl nao tem binario para este sistema\"));\n\n    let client = crate::core::http_client::apply_global_proxy(reqwest::Client::builder())\n        .timeout(std::time::Duration::from_secs(180))\n        .build()?;\n\n    let response = client.get(url).send().await?;\n    if !response.status().is_success() {\n        return Err(anyhow!(\n            \"Failed to download gallery-dl: HTTP {}\",\n            response.status()\n        ));\n    }\n\n    let bytes = response.bytes().await?;\n    let data = bytes.to_vec();\n    let target_clone = target.clone();\n    tokio::task::spawn_blocking(move || -> anyhow::Result<()> {\n        std::fs::write(&target_clone, &data)?;","sourceCodeStart":805,"sourceCodeEnd":841,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/dependencies.rs#L805-L841","documentation":"Raised in download_gallerydl on any target OS other than Windows, Linux, or macOS. gallery-dl standalone executables are only published for those three platforms in the gdl-org/builds repo, so on other systems the function returns this error instead of attempting a download.","triggerScenarios":"Compiling/running Omniget's gallery-dl bootstrap on a cfg target that is not windows/linux/macos (e.g. FreeBSD, Android, wasm) — the #[cfg(not(any(...)))] branch is compiled in and returns immediately.","commonSituations":"Building for FreeBSD or OpenBSD; cross-compiling to an embedded/mobile target; running the core in a wasm/unsupported environment.","solutions":["Run on Windows, Linux, or macOS, where prebuilt gallery-dl binaries exist","On unsupported platforms install gallery-dl system-wide (pip install gallery-dl) and make it available on PATH instead of using the managed binary","Contribute a fallback branch that downloads the Python package or builds from source for other targets"],"exampleFix":"// before\n#[cfg(not(any(target_os = \"windows\", target_os = \"linux\", target_os = \"macos\")))]\nreturn Err(anyhow!(\"gallery-dl nao tem binario para este sistema\"));\n// after\n#[cfg(not(any(target_os = \"windows\", target_os = \"linux\", target_os = \"macos\")))]\n{\n    // fall back to a system gallery-dl on PATH\n    if which::which(\"gallery-dl\").is_ok() {\n        return Ok(which::which(\"gallery-dl\").unwrap());\n    }\n    return Err(anyhow!(\"gallery-dl nao tem binario para este sistema\"));\n}","handlingStrategy":"fallback","validationCode":"// compile-time / runtime platform check before bootstrapping gallery-dl\n#[cfg(not(any(target_os = \"windows\", target_os = \"linux\", target_os = \"macos\")))]\nfn gallerydl_supported() -> bool { false }\n#[cfg(any(target_os = \"windows\", target_os = \"linux\", target_os = \"macos\"))]\nfn gallerydl_supported() -> bool { true }","typeGuard":"fn is_supported_platform() -> bool {\n    matches!(\n        std::env::consts::OS.as_str(),\n        \"windows\" | \"linux\" | \"macos\"\n    )\n}","tryCatchPattern":"if !is_supported_platform() {\n    // use system gallery-dl instead of the managed binary\n    return which::which(\"gallery-dl\")\n        .map_err(|_| anyhow!(\"gallery-dl nao tem binario para este sistema\"));\n}","preventionTips":["Gate gallery-dl bootstrap behind a supported-platform check at startup","Install gallery-dl via pip/cargo as a system fallback on exotic platforms","Document supported platforms (Windows/Linux/macOS) in setup docs","Use cfg attributes to exclude the managed-download path from unsupported builds"],"tags":["platform","unsupported-platform","gallery-dl","compile-time"],"backgroundTag":"unsupported-platform","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"}