tonhowtf/omniget · error · anyhow::Error

acesso negado (HTTP ). Capture os cookies da sua conta no…

Error message

acesso negado (HTTP {}). Capture os cookies da sua conta no gerenciador e tente de novo

What it means

The shared HTTP client get_text() immediately aborts on HTTP 401/403 instead of retrying, because retrying an auth rejection will not help. It wraps the status into this Portuguese message telling the user to capture their account cookies.

Solutions

  1. Capture fresh cookies for the site (medium.com) in the cookie/session manager and retry
  2. Verify you are logged into the correct account in the browser the cookies came from
  3. Ensure the request targets a URL the account actually has access to
Defensive patterns

Strategy: try-catch

Try / catch

match fetcher.get_text(url).await {
    Err(e) if e.to_string().contains("acesso negado") => {
        refresh_cookies();
        return fetcher.get_text(url).await;
    }
    other => other,
}

Prevention

When it happens

Trigger: Any GET through the client (directly via get_text, or indirectly via get_json or trigger_and_wait) where the server responds 401 or 403.

Common situations: Missing or expired medium.com cookies when hitting private endpoints; cookies captured for the wrong account; the target site blocks non-browser user agents; session revoked server-side.

Related errors


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

Appendix: source

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

            let since = t.elapsed();
            if since < self.delay {
                tokio::time::sleep(self.delay - since).await;
            }
        }
        *last = Some(Instant::now());
    }

    /// GET com texto de volta. Repete em 429 e em erro de servidor.
    pub async fn get_text(&self, url: &str) -> Result<String> {
        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())

View on GitHub (pinned to 8600b91f42)