tonhowtf/omniget · warning
arquivo vazio
Error message
arquivo vazio
What it means
fetch_one() bails with "arquivo vazio" when the HTTP response succeeds (2xx) but the downloaded body has zero bytes. The library refuses to write empty image files, so a 200-with-empty-body (usually a broken CDN response or wrong content negotiation) surfaces as this error instead of silently creating a 0-byte image.
Solutions
- Retry the download — empty-200 responses are often transient CDN issues (and 429/5xx already retry internally, this case does not).
- Delete the partially-downloaded emote set and re-run to refresh URLs from the provider API.
- Check proxy/antivirus interference if many downloads come back empty.
- Verify the URL manually; if consistently empty, treat that emote as unavailable and skip it.
Defensive patterns
Strategy: retry
Try / catch
let mut attempt = 0;
loop {
match emotes::run(&opts, &progress).await {
Err(e) if e.to_string().contains("arquivo vazio") && attempt < 2 => {
attempt += 1;
tokio::time::sleep(Duration::from_secs(5 * attempt)).await;
}
other => break other,
}
} Prevention
- Retry empty-body downloads after a short delay — the tool only auto-retries 429/5xx, not empty 200s.
- Check proxy/antivirus software that can strip response bodies.
- Re-fetch emote URLs from the provider API rather than reusing cached ones.
- Verify downloaded files are non-empty and valid images before use.
When it happens
Trigger: Calling run() when an emote CDN returns HTTP 200 with an empty body: broken/empty CDN object, misconfigured proxy stripping the body, or a URL that responds 200 empty instead of 404 for deleted content.
Common situations: CDN edge serving stale empty objects; intercepting proxies/antivirus stripping bodies; provider changing image URLs so the old path now returns an empty 200.
Related errors
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/b04d01c0dbfdcf47.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/twitch/emotes.rs:834
}
let resp = match http.get(url).send().await {
Ok(r) => r,
Err(e) => {
last = e.to_string();
continue;
}
};
let status = resp.status();
if status.as_u16() == 429 || status.is_server_error() {
last = format!("HTTP {}", status);
continue;
}
if !status.is_success() {
anyhow::bail!("HTTP {}", status);
}
let bytes = resp.bytes().await?;
if bytes.is_empty() {
anyhow::bail!("arquivo vazio");
}
std::fs::write(path, &bytes)?;
return Ok(());
}
Err(anyhow!("{}", last))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn le_emotes_e_badges_da_twitch() {
let user = json!({
"subscriptionProducts": [
{ "emotes": [
{ "id": "emotesv2_abc", "token": "xqcSlam", "assetType": "ANIMATED" },
{ "id": "305535174", "token": "xqcOmega", "assetType": "STATIC" }View on GitHub (pinned to 8600b91f42)