{"record":{"id":"be06e33fff63ddb0","repo":"tonhowtf/omniget","slug":"post-not-available-status-mod","errorCode":null,"errorMessage":"Post not available (status {})","messagePattern":"Post not available \\(status (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/tiktok/mod.rs","lineNumber":188,"sourceCode":"        let data: serde_json::Value = serde_json::from_str(json_str)\n            .map_err(|_| anyhow!(\"Erro ao processar resposta do TikTok\"))?;\n\n        let video_detail = data\n            .get(\"__DEFAULT_SCOPE__\")\n            .and_then(|s| s.get(\"webapp.video-detail\"))\n            .ok_or_else(|| anyhow!(\"Video data not found in TikTok response\"))?;\n\n        if let Some(status_msg) = video_detail\n            .get(\"statusMsg\")\n            .and_then(|v| v.as_str())\n            .filter(|s| !s.is_empty())\n        {\n            return Err(anyhow!(\"Post not available: {}\", status_msg));\n        }\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\"));","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/tiktok/mod.rs#L170-L206","documentation":"When the video-detail payload's statusCode field is present and non-zero, fetch_detail reports the post as unavailable with the numeric code. Zero means success; any other value is TikTok signaling a failure condition for the item.","triggerScenarios":"The webapp.video-detail JSON contains statusCode != 0 (e.g. 10216 private video, 10202/10204 deleted or blocked content) even though the page and JSON parsed fine.","commonSituations":"Private/friends-only videos, deleted posts, age- or region-restricted content, or TikTok API-level rejections surfaced inside an otherwise normal page.","solutions":["Map known TikTok statusCodes to user-friendly messages","Check statusMsg first — it often explains the statusCode","Inform the user the specific post cannot be fetched and why (if code is known)","Update the status-code mapping if TikTok introduces new codes"],"exampleFix":"// before\nif status_code != 0 {\n    return Err(anyhow!(\"Post not available (status {})\", status_code));\n}\n// after\nif status_code != 0 {\n    return Err(anyhow!(\"Post not available (status {}: {})\", status_code, describe_tiktok_status(status_code)));\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match get_media_info(url).await {\n    Err(e) if e.to_string().contains(\"Post not available (status\") => {\n        let code = extract_status_code(&e);\n        handle_known_status(code)\n    }\n    other => other,\n}","preventionTips":["Map known TikTok statusCodes to actionable messages","Check statusMsg alongside statusCode for context","Skip permanent codes (private/deleted); retry only ambiguous ones"],"tags":["tiktok","api-error","status-code"],"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-23T08:17:48.524Z"}