tonhowtf/omniget · error · anyhow::Error

Twitch GQL token retornou HTTP

Error message

Twitch GQL token retornou HTTP {}

What it means

The persisted-query GQL request for a clip's playback access token returned a non-success HTTP status; the {} is the raw code. The sha256Hash-pinned query was rejected at the HTTP level — typically rate limiting, an expired persisted-query hash, or a Twitch-side error.

Solutions

  1. Retry after a short wait if rate limited
  2. Update the app so TOKEN_HASH matches Twitch's current persisted query
  3. Use yt-dlp download mode as a fallback for this clip
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src-tauri/src/platforms/twitch/mod.rs:220 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src-tauri/src/platforms/twitch/mod.rs:220

            "variables": { "slug": slug },
            "extensions": {
                "persistedQuery": {
                    "version": 1,
                    "sha256Hash": TOKEN_HASH
                }
            }
        }]);

        let response = self
            .client
            .post(GQL_URL)
            .header("client-id", CLIENT_ID)
            .json(&body)
            .send()
            .await?;

        if !response.status().is_success() {
            return Err(anyhow!(
                "Twitch GQL token retornou HTTP {}",
                response.status()
            ));
        }

        let json: serde_json::Value = response.json().await?;

        let token_obj = json
            .as_array()
            .and_then(|arr| arr.first())
            .and_then(|r| r.pointer("/data/clip/playbackAccessToken"))
            .ok_or_else(|| anyhow!("Access token not available for clip: {}", slug))?;

        let signature = token_obj
            .get("signature")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow!("Token sem signature"))?
            .to_string();

View on GitHub (pinned to 8600b91f42)