tonhowtf/omniget · error

Video data not found in TikTok response

Error message

Video data not found in TikTok response

What it means

The rehydration JSON parsed successfully, but it does not contain the expected __DEFAULT_SCOPE__ > "webapp.video-detail" key. TikTok's response shape changed or the page is not a video detail page. The library treats a missing key as a hard error rather than returning empty data.

Solutions

  1. Verify the URL is a direct video URL (tiktok.com/@user/video/<id>), not a profile or photo post link.
  2. Retry with cookies/session headers so TikTok serves the full video-detail payload.
  3. Update/upgrade the omniget client in case TikTok changed its schema and a newer build handles it.
  4. Fall back to get_media_info_via_ytdlp for URL extraction.

Example fix

// defensive caller check before trusting the parsed detail
if let Err(e) = tiktok.get_media_info(url).await {
    if e.to_string().contains("Video data not found") {
        return tiktok.get_media_info_via_ytdlp(url, &post_id).await;
    }
    return Err(e);
}
Defensive patterns

Strategy: fallback

Try / catch

match tiktok.get_media_info(url).await {
    Err(e) if e.to_string().contains("Video data not found") => tiktok.get_media_info_via_ytdlp(url, &post_id).await,
    other => other,
}

Prevention

When it happens

Trigger: fetch_detail calls data.get("__DEFAULT_SCOPE__").and_then(|s| s.get("webapp.video-detail")) and the Option is None — e.g. TikTok returned a login wall, a regional block, or renamed/restructured the payload.

Common situations: TikTok A/B testing a new payload schema; the URL pointed to a user profile or photo post rather than a video; logged-out requests being redirected to a signup page; region-locked content.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/platforms/tiktok.rs:176

        if Self::is_captcha_page(&html) {
            return Err(anyhow!(
                "TikTok is blocking requests. Try again in a few minutes."
            ));
        }

        let json_str = html
            .split("<script id=\"__UNIVERSAL_DATA_FOR_REHYDRATION__\" type=\"application/json\">")
            .nth(1)
            .and_then(|s| s.split("</script>").next())
            .ok_or_else(|| anyhow!("TikTok is blocking requests. Try again in a few minutes."))?;

        let data: serde_json::Value = serde_json::from_str(json_str)
            .map_err(|_| anyhow!("Erro ao processar resposta do TikTok"))?;

        let video_detail = data
            .get("__DEFAULT_SCOPE__")
            .and_then(|s| s.get("webapp.video-detail"))
            .ok_or_else(|| anyhow!("Video data not found in TikTok response"))?;

        if let Some(status_msg) = video_detail
            .get("statusMsg")
            .and_then(|v| v.as_str())
            .filter(|s| !s.is_empty())
        {
            return Err(anyhow!("Post not available: {}", status_msg));
        }

        if let Some(status_code) = video_detail.get("statusCode").and_then(|v| v.as_u64()) {
            if status_code != 0 {
                return Err(anyhow!("Post not available (status {})", status_code));
            }
        }

        let detail = video_detail
            .pointer("/itemInfo/itemStruct")
            .ok_or_else(|| anyhow!("Video data not found in TikTok response"))?

View on GitHub (pinned to 8600b91f42)