{"record":{"id":"7eee026de9ba952b","repo":"tonhowtf/omniget","slug":"o-trakt-est-limitando-o-acesso-http","errorCode":null,"errorMessage":"o Trakt está limitando o acesso (HTTP {})","messagePattern":"o Trakt está limitando o acesso \\(HTTP (.+?)\\)","errorType":"exception","errorClass":"anyhow","httpStatus":429,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/lists/trakt.rs","lineNumber":499,"sourceCode":"                    \"o Trakt recusou o token (401). Reconecte a conta no botão acima\"\n                ));\n            }\n            if status.as_u16() == 426 {\n                return Err(anyhow!(\"esse recurso é só para contas VIP do Trakt\"));\n            }\n            if status.as_u16() == 420 {\n                return Err(anyhow!(\n                    \"a conta do Trakt bateu no limite do plano gratuito (HTTP 420)\"\n                ));\n            }\n            if status.as_u16() == 423 {\n                return Err(anyhow!(\n                    \"a conta do Trakt está bloqueada; fale com o suporte deles\"\n                ));\n            }\n            if status.as_u16() == 429 || status.is_server_error() {\n                if attempt == 4 {\n                    return Err(anyhow!(\"o Trakt está limitando o acesso (HTTP {})\", status));\n                }\n                let retry = r\n                    .headers()\n                    .get(reqwest::header::RETRY_AFTER)\n                    .and_then(|v| v.to_str().ok())\n                    .and_then(|v| v.trim().parse::<u64>().ok())\n                    .map(Duration::from_secs);\n                tokio::time::sleep(retry.unwrap_or(wait)).await;\n                wait *= 2;\n                continue;\n            }\n            if !status.is_success() {\n                return Err(anyhow!(\"HTTP {} em {}\", status, url));\n            }\n            let pages = r\n                .headers()\n                .get(\"x-pagination-page-count\")\n                .and_then(|v| v.to_str().ok())","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/lists/trakt.rs#L481-L517","documentation":"After 5 attempts (attempt == 4) of receiving HTTP 429 or any 5xx from Trakt, get_page gives up and reports the limiting status. The library already honored Retry-After headers with exponential backoff between attempts, so this error means the API stayed rate-limited or unavailable through all retries.","triggerScenarios":"get_page (via get_all) gets 429 Too Many Requests or a 5xx server error on every one of its 5 attempts despite Retry-After backoff (wait doubling each retry).","commonSituations":"Bulk export of many lists in a tight loop exceeding Trakt's per-5-minute call budget; Trakt outage or degraded API; opts.delay_ms set too low for the account tier.","solutions":["Increase opts.delay_ms passed to Api::new to space out requests","Retry the export later — Trakt rate-limit windows reset every 5 minutes","Reduce the number of lists/pages fetched per run (opts.max_pages, fewer lists in want)","Check https://status.trakt.tv or the API for an ongoing incident","Upgrade to VIP for higher rate limits"],"exampleFix":"// before\nlet api = Api::new(&c, 0)?;\n// after\nlet api = Api::new(&c, 1500)?; // at least ~1.5s between calls","handlingStrategy":"retry","validationCode":"// before running, ensure a conservative delay\nassert!(opts.delay_ms >= 1000, \"increase delay_ms to respect Trakt rate limits\");","typeGuard":null,"tryCatchPattern":"if let Err(e) = trakt_lists::run(&opts, &progress) {\n    if e.to_string().contains(\"limitando o acesso\") {\n        tokio::time::sleep(Duration::from_secs(300)).await; // wait out the 5-min window\n        // then retry with a larger delay_ms\n    }\n}","preventionTips":["Set opts.delay_ms to at least ~1-1.5s between API calls","Check status.trakt.tv before large batch exports","Spread big exports across multiple runs"],"tags":["trakt","http-429","rate-limit","retry-exhausted"],"backgroundTag":"rate-limit-exceeded","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}