{"record":{"id":"291367d44e042e28","repo":"tonhowtf/omniget","slug":"syndication-api-retornou-http","errorCode":null,"errorMessage":"Syndication API retornou HTTP {}","messagePattern":"Syndication API retornou HTTP (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/twitter.rs","lineNumber":394,"sourceCode":"            \"https://cdn.syndication.twimg.com/tweet-result?id={}&token={}\",\n            tweet_id, token\n        );\n\n        let mut request = self.client.get(&url);\n        if let Some(cookie) = Self::auth_cookie_string() {\n            request = request.header(\"Cookie\", cookie);\n        }\n\n        let response = request.send().await?;\n        tracing::debug!(\n            \"[twitter] syndication tweet_id={} token={} status={}\",\n            tweet_id,\n            token,\n            response.status()\n        );\n\n        if !response.status().is_success() {\n            return Err(anyhow!(\n                \"Syndication API retornou HTTP {}\",\n                response.status()\n            ));\n        }\n\n        response.json().await.map_err(Into::into)\n    }\n\n    fn extract_graphql_media(\n        json: &serde_json::Value,\n        tweet_id: &str,\n    ) -> anyhow::Result<Vec<serde_json::Value>> {\n        let instructions = json\n            .pointer(\"/data/threaded_conversation_with_injections_v2/instructions\")\n            .and_then(|v| v.as_array())\n            .ok_or_else(|| anyhow!(\"Post not available\"))?;\n\n        let add_insn = instructions","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/platforms/twitter.rs#L376-L412","documentation":"request_syndication fails with this error when Twitter's syndication CDN endpoint (cdn.syndication.twimg.com/tweet-result) returns a non-2xx status. This is the fallback path for tweet media extraction, used when GraphQL is unavailable.","triggerScenarios":"The syndication endpoint returns 404 (tweet unavailable), 403 (bot detection / invalid calculated syndication token), 429 (rate limited), or 5xx.","commonSituations":"The calculate_syndication_token algorithm no longer matches Twitter's expectations (403); tweet removed or geo-restricted (404); CDN rate limiting heavy use.","solutions":["Verify the token calculation in calculate_syndication_token is still valid (Twitter changes it periodically)","Check the tweet is accessible logged-out in a browser","Retry on 5xx/429 with backoff","Try the GraphQL path instead if syndication keeps failing"],"exampleFix":"// before\nif !response.status().is_success() {\n    return Err(anyhow!(\"Syndication API retornou HTTP {}\", response.status()));\n}\n// after\nlet status = response.status();\nif !status.is_success() {\n    let body = response.text().await.unwrap_or_default();\n    return Err(anyhow!(\"Syndication API retornou HTTP {}: {}\", status, body));\n}","handlingStrategy":"fallback","validationCode":"// only call syndication if the tweet ID is numeric and non-empty\nfn syndication_eligible(id: &str) -> bool { !id.is_empty() && id.chars().all(|c| c.is_ascii_digit()) }","typeGuard":null,"tryCatchPattern":"// try GraphQL first, syndication as fallback\nnative_get_media_info(url).or_else(|_| syndication_get_media_info(url))","preventionTips":["Keep calculate_syndication_token in sync with the current web client algorithm","Rate-limit syndication calls; the CDN throttles aggressively","Log status + body on failure for fast diagnosis","Use syndication only as a fallback, not the primary path"],"tags":["twitter","syndication","http","fallback"],"backgroundTag":"upstream-api-error","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"}