tonhowtf/omniget · error · anyhow::Error

o servidor está limitando o acesso

Error message

o servidor está limitando o acesso (HTTP {}). Tente de novo daqui a pouco

What it means

On HTTP 429 or 5xx, get_text() retries with exponential backoff (with an optional Retry-After hint) up to TRIES attempts. Only when the last attempt still fails does it surface this error telling the user the server is rate limiting or broken.

Solutions

  1. Wait a few minutes and retry the export later
  2. Reduce request volume (lower opts.limit, export fewer formats/users at once)
  3. Remove proxies/VPNs that may share a rate-limited IP
  4. If persistent, check the target service status page for an outage
Defensive patterns

Strategy: retry

Try / catch

match fetcher.get_text(url).await {
    Err(e) if e.to_string().contains("limitando o acesso") => {
        tokio::time::sleep(Duration::from_secs(300)).await;
        return fetcher.get_text(url).await;
    }
    other => other,
}

Prevention

When it happens

Trigger: Every one of the TRIES retry attempts against the URL returned 429 or a 5xx status.

Common situations: Exporting large feeds too fast against Medium's rate limits; Medium incident/outage; shared IP (proxy/VPN) throttled by the server.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/blogs/mod.rs:173

        const TRIES: u32 = 4;
        let mut wait = Duration::from_secs(3);
        for attempt in 1..=TRIES {
            self.pace().await;
            self.requests.fetch_add(1, Ordering::Relaxed);
            match self.client.get(url).send().await {
                Ok(r) if r.status().is_success() => return Ok(r.text().await?),
                Ok(r) if r.status().as_u16() == 401 || r.status().as_u16() == 403 => {
                    return Err(anyhow!(
                        "acesso negado (HTTP {}). Capture os cookies da sua conta no gerenciador e tente de novo",
                        r.status()
                    ));
                }
                Ok(r) if r.status().as_u16() == 404 => {
                    return Err(anyhow!("não encontrado: {}", url));
                }
                Ok(r) if r.status().as_u16() == 429 || r.status().is_server_error() => {
                    if attempt == TRIES {
                        return Err(anyhow!(
                            "o servidor está limitando o acesso (HTTP {}). Tente de novo daqui a pouco",
                            r.status()
                        ));
                    }
                    let retry = r
                        .headers()
                        .get(reqwest::header::RETRY_AFTER)
                        .and_then(|v| v.to_str().ok())
                        .and_then(|v| v.trim().parse::<u64>().ok())
                        .map(Duration::from_secs);
                    tokio::time::sleep(retry.unwrap_or(wait)).await;
                    wait *= 2;
                }
                Ok(r) => return Err(anyhow!("HTTP {} em {}", r.status(), url)),
                Err(e) if attempt < TRIES => {
                    tokio::time::sleep(wait).await;
                    wait *= 2;
                    let _ = e;

View on GitHub (pinned to 8600b91f42)