{"record":{"id":"1c6683ffdd24ad9e","repo":"tonhowtf/omniget","slug":"age-restricted-content-mod","errorCode":null,"errorMessage":"Age-restricted content","messagePattern":"Age-restricted content","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src-tauri/src/platforms/tiktok/mod.rs","lineNumber":202,"sourceCode":"        }\n\n        if let Some(status_code) = video_detail.get(\"statusCode\").and_then(|v| v.as_u64()) {\n            if status_code != 0 {\n                return Err(anyhow!(\"Post not available (status {})\", status_code));\n            }\n        }\n\n        let detail = video_detail\n            .pointer(\"/itemInfo/itemStruct\")\n            .ok_or_else(|| anyhow!(\"Video data not found in TikTok response\"))?\n            .clone();\n\n        if detail\n            .get(\"isContentClassified\")\n            .and_then(|v| v.as_bool())\n            .unwrap_or(false)\n        {\n            return Err(anyhow!(\"Age-restricted content\"));\n        }\n\n        if detail.get(\"author\").is_none() {\n            return Err(anyhow!(\"Post not available\"));\n        }\n\n        Ok(detail)\n    }\n\n    fn extract_author(detail: &serde_json::Value) -> String {\n        detail\n            .pointer(\"/author/uniqueId\")\n            .or_else(|| detail.pointer(\"/author/unique_id\"))\n            .and_then(|v| v.as_str())\n            .unwrap_or(\"unknown\")\n            .to_string()\n    }\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/tiktok/mod.rs#L184-L220","documentation":"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.","triggerScenarios":"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.","commonSituations":"Downloading videos flagged as sensitive/age-gated; region-specific content classification; TikTok tightening classification of borderline content.","solutions":["Open the post in a browser and confirm the age/sensitive-content warning to verify it is gated.","Use the yt-dlp fallback path with browser cookies (--cookies-from-browser) which can access age-gated content.","Surface this as a user-facing message explaining the post cannot be fetched anonymously.","There is no bypass in the native path; consider skipping or queuing with yt-dlp."],"exampleFix":"// before\nif detail.get(\"isContentClassified\").and_then(|v| v.as_bool()).unwrap_or(false) {\n    return Err(anyhow!(\"Age-restricted content\"));\n}\n// after\nif detail.get(\"isContentClassified\").and_then(|v| v.as_bool()).unwrap_or(false) {\n    return Err(anyhow!(\"Age-restricted content — try fetching with yt-dlp and browser cookies\"));\n}","handlingStrategy":"fallback","validationCode":"// Pre-check the detail before building MediaInfo\nlet gated = detail.get(\"isContentClassified\")\n    .and_then(|v| v.as_bool())\n    .unwrap_or(false);\nif gated { eprintln!(\"post is age-restricted; use yt-dlp with cookies\"); }","typeGuard":"fn is_age_restricted(detail: &serde_json::Value) -> bool {\n    detail.get(\"isContentClassified\").and_then(|v| v.as_bool()).unwrap_or(false)\n}","tryCatchPattern":"match get_media_info(url).await {\n    Err(e) if e.to_string().contains(\"Age-restricted\") => notify_user(\"Post is age-restricted\"),\n    other => other,\n}","preventionTips":["Detect the flag early and switch to yt-dlp with browser cookies instead of failing late.","Show a clear user-facing message rather than a raw error.","Cache which posts are gated to avoid repeated fetches."],"tags":["tiktok","content-policy","age-restriction","scraping"],"backgroundTag":"api-error-response","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"}