{"record":{"id":"52120a3dfceeb021","repo":"tonhowtf/omniget","slug":"acesso-negado-http-capture-os-cookies-da-sua-conta-no","errorCode":null,"errorMessage":"acesso negado (HTTP {}). Capture os cookies da sua conta no gerenciador e tente de novo","messagePattern":"acesso negado \\(HTTP (.+?)\\)\\. Capture os cookies da sua conta no gerenciador e tente de novo","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/blogs/mod.rs","lineNumber":163,"sourceCode":"            let since = t.elapsed();\n            if since < self.delay {\n                tokio::time::sleep(self.delay - since).await;\n            }\n        }\n        *last = Some(Instant::now());\n    }\n\n    /// GET com texto de volta. Repete em 429 e em erro de servidor.\n    pub async fn get_text(&self, url: &str) -> Result<String> {\n        const TRIES: u32 = 4;\n        let mut wait = Duration::from_secs(3);\n        for attempt in 1..=TRIES {\n            self.pace().await;\n            self.requests.fetch_add(1, Ordering::Relaxed);\n            match self.client.get(url).send().await {\n                Ok(r) if r.status().is_success() => return Ok(r.text().await?),\n                Ok(r) if r.status().as_u16() == 401 || r.status().as_u16() == 403 => {\n                    return Err(anyhow!(\n                        \"acesso negado (HTTP {}). Capture os cookies da sua conta no gerenciador e tente de novo\",\n                        r.status()\n                    ));\n                }\n                Ok(r) if r.status().as_u16() == 404 => {\n                    return Err(anyhow!(\"não encontrado: {}\", url));\n                }\n                Ok(r) if r.status().as_u16() == 429 || r.status().is_server_error() => {\n                    if attempt == TRIES {\n                        return Err(anyhow!(\n                            \"o servidor está limitando o acesso (HTTP {}). Tente de novo daqui a pouco\",\n                            r.status()\n                        ));\n                    }\n                    let retry = r\n                        .headers()\n                        .get(reqwest::header::RETRY_AFTER)\n                        .and_then(|v| v.to_str().ok())","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/blogs/mod.rs#L145-L181","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Capture fresh cookies for the site (medium.com) in the cookie/session manager and retry","Verify you are logged into the correct account in the browser the cookies came from","Ensure the request targets a URL the account actually has access to"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match fetcher.get_text(url).await {\n    Err(e) if e.to_string().contains(\"acesso negado\") => {\n        refresh_cookies();\n        return fetcher.get_text(url).await;\n    }\n    other => other,\n}","preventionTips":["Capture fresh cookies before running authenticated exports","Check that cookies correspond to the right account/site","Detect 401/403 early and prompt for re-authentication instead of retrying"],"tags":["http","authentication","network"],"backgroundTag":"authentication-required","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}