tonhowtf/omniget · error

Syndication API retornou HTTP

Error message

Syndication API retornou HTTP {}

What it means

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.

Solutions

  1. Verify the token calculation in calculate_syndication_token is still valid (Twitter changes it periodically)
  2. Check the tweet is accessible logged-out in a browser
  3. Retry on 5xx/429 with backoff
  4. Try the GraphQL path instead if syndication keeps failing

Example fix

// before
if !response.status().is_success() {
    return Err(anyhow!("Syndication API retornou HTTP {}", response.status()));
}
// after
let status = response.status();
if !status.is_success() {
    let body = response.text().await.unwrap_or_default();
    return Err(anyhow!("Syndication API retornou HTTP {}: {}", status, body));
}
Defensive patterns

Strategy: fallback

Validate before calling

// only call syndication if the tweet ID is numeric and non-empty
fn syndication_eligible(id: &str) -> bool { !id.is_empty() && id.chars().all(|c| c.is_ascii_digit()) }

Try / catch

// try GraphQL first, syndication as fallback
native_get_media_info(url).or_else(|_| syndication_get_media_info(url))

Prevention

When it happens

Trigger: The syndication endpoint returns 404 (tweet unavailable), 403 (bot detection / invalid calculated syndication token), 429 (rate limited), or 5xx.

Common situations: The calculate_syndication_token algorithm no longer matches Twitter's expectations (403); tweet removed or geo-restricted (404); CDN rate limiting heavy use.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/platforms/twitter.rs:394

            "https://cdn.syndication.twimg.com/tweet-result?id={}&token={}",
            tweet_id, token
        );

        let mut request = self.client.get(&url);
        if let Some(cookie) = Self::auth_cookie_string() {
            request = request.header("Cookie", cookie);
        }

        let response = request.send().await?;
        tracing::debug!(
            "[twitter] syndication tweet_id={} token={} status={}",
            tweet_id,
            token,
            response.status()
        );

        if !response.status().is_success() {
            return Err(anyhow!(
                "Syndication API retornou HTTP {}",
                response.status()
            ));
        }

        response.json().await.map_err(Into::into)
    }

    fn extract_graphql_media(
        json: &serde_json::Value,
        tweet_id: &str,
    ) -> anyhow::Result<Vec<serde_json::Value>> {
        let instructions = json
            .pointer("/data/threaded_conversation_with_injections_v2/instructions")
            .and_then(|v| v.as_array())
            .ok_or_else(|| anyhow!("Post not available"))?;

        let add_insn = instructions

View on GitHub (pinned to 8600b91f42)