tonhowtf/omniget · error

gallery-dl falhou

Error message

gallery-dl falhou: {}

What it means

After the gallery-dl child exits, download() inspects its status: a non-zero exit with zero files downloaded is converted into this error carrying the collected stderr tail. If some files were downloaded, the failure is tolerated.

Solutions

  1. Read the stderr tail in the error — it names the extractor/HTTP failure
  2. Pass a valid cookies_file for sites requiring login; refresh expired cookies
  3. Update gallery-dl to the latest version (site extractors change frequently) and retry

Example fix

// before
let r = gallery::download(url, dest, None, progress).await?;
// after (login-required site)
let r = gallery::download(url, dest, Some("cookies.txt"), progress).await?;
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight: is the URL reachable and does it need cookies?
let needs_cookies = url.contains("twitter") || url.contains("pixiv"); // example
if needs_cookies && cookies_file.is_none() {
    return Err(anyhow!("este site exige cookies de login"));
}

Try / catch

match gallery::download(url, dest, cookies, progress).await {
    Err(e) if e.to_string().contains("gallery-dl falhou") => {
        // inspect tail for 403/429 and advise user
        Err(anyhow!("download da galeria falhou — verifique login/limite: {e}"))
    }
    other => other,
}

Prevention

When it happens

Trigger: gallery-dl exits non-zero and produced no files — bad URL, unsupported site, HTTP 403/429 from the host, expired cookies, or no network.

Common situations: Rate limiting or login-required galleries (missing/expired cookies file); site gallery-dl no longer supports (extractor drift after site changes); typo in the gallery URL.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/ab6f42e19bba9e77. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/gallery.rs:97

            }
        }
        files
    });
    let err_task = tokio::spawn(async move {
        let mut tail = String::new();
        if let Some(e) = stderr {
            let mut lines = BufReader::new(e).lines();
            while let Ok(Some(line)) = lines.next_line().await {
                tail = line;
            }
        }
        tail
    });
    let status = child.wait().await?;
    let files = out_task.await.unwrap_or_default();
    let tail = err_task.await.unwrap_or_default();
    if !status.success() && files.is_empty() {
        return Err(anyhow!("gallery-dl falhou: {}", tail));
    }
    super::report(
        &progress,
        &id,
        "done",
        files.len() as u64,
        Some(files.len() as u64),
        None,
    );
    Ok(GalleryResult {
        files,
        dest: dest.to_string(),
        log_tail: tail,
    })
}

View on GitHub (pinned to 8600b91f42)