tonhowtf/omniget · warning

Age-restricted content

Error message

Age-restricted content

What it means

After successfully extracting the itemStruct, fetch_detail checks the isContentClassified boolean flag on the post. If TikTok marked the content as classified (age-gated or sensitive content requiring login/confirmation), this error aborts processing because the media URLs will not be accessible to the anonymous scraper.

Solutions

  1. Open the post in a browser and confirm the age/sensitive-content warning to verify it is gated.
  2. Use the yt-dlp fallback path with browser cookies (--cookies-from-browser) which can access age-gated content.
  3. Surface this as a user-facing message explaining the post cannot be fetched anonymously.
  4. There is no bypass in the native path; consider skipping or queuing with yt-dlp.

Example fix

// before
if detail.get("isContentClassified").and_then(|v| v.as_bool()).unwrap_or(false) {
    return Err(anyhow!("Age-restricted content"));
}
// after
if detail.get("isContentClassified").and_then(|v| v.as_bool()).unwrap_or(false) {
    return Err(anyhow!("Age-restricted content — try fetching with yt-dlp and browser cookies"));
}
Defensive patterns

Strategy: fallback

Validate before calling

// Pre-check the detail before building MediaInfo
let gated = detail.get("isContentClassified")
    .and_then(|v| v.as_bool())
    .unwrap_or(false);
if gated { eprintln!("post is age-restricted; use yt-dlp with cookies"); }

Type guard

fn is_age_restricted(detail: &serde_json::Value) -> bool {
    detail.get("isContentClassified").and_then(|v| v.as_bool()).unwrap_or(false)
}

Try / catch

match get_media_info(url).await {
    Err(e) if e.to_string().contains("Age-restricted") => notify_user("Post is age-restricted"),
    other => other,
}

Prevention

When it happens

Trigger: get_media_info called on a TikTok post whose itemStruct contains isContentClassified: true — age-restricted videos, sensitive-content-flagged posts, or posts TikTok requires login confirmation for.

Common situations: Downloading videos flagged as sensitive/age-gated; region-specific content classification; TikTok tightening classification of borderline content.

Related errors


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

Appendix: source

Thrown at src-tauri/src/platforms/tiktok/mod.rs:202

        }

        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"))?
            .clone();

        if detail
            .get("isContentClassified")
            .and_then(|v| v.as_bool())
            .unwrap_or(false)
        {
            return Err(anyhow!("Age-restricted content"));
        }

        if detail.get("author").is_none() {
            return Err(anyhow!("Post not available"));
        }

        Ok(detail)
    }

    fn extract_author(detail: &serde_json::Value) -> String {
        detail
            .pointer("/author/uniqueId")
            .or_else(|| detail.pointer("/author/unique_id"))
            .and_then(|v| v.as_str())
            .unwrap_or("unknown")
            .to_string()
    }

View on GitHub (pinned to 8600b91f42)