{"record":{"id":"86188bb49acdf23f","repo":"tonhowtf/omniget","slug":"post-not-available-status","errorCode":null,"errorMessage":"Post not available (status {})","messagePattern":"Post not available \\(status (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/tiktok.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/omniget-core/src/platforms/tiktok.rs#L170-L206","documentation":"TikTok returned a numeric statusCode in the video-detail payload that is not 0 (0 = OK). The library maps any non-zero code to 'Post not available (status N)', exposing TikTok's numeric error code to the caller.","triggerScenarios":"fetch_detail finds video_detail.statusCode as a u64 != 0 (and no statusMsg was present), and returns the formatted error with the raw code.","commonSituations":"status 10216/10221-style codes for private or removed videos; content status codes for geo-restriction; rate-limit or verification codes after too many scraping requests.","solutions":["Look up the numeric status in TikTok's web API error code list to identify the cause.","If the code indicates removal/privacy, treat the post as unavailable and inform the user.","If it indicates throttling/verification, back off and retry later or with new session cookies.","Try the yt-dlp fallback path which uses TikTok's extraction independent of this status code."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match tiktok.get_media_info(url).await {\n    Err(e) if e.to_string().starts_with(\"Post not available (status \") => {\n        let code: Option<u64> = /* parse digits between parens */ None;\n        // branch on code: privacy vs rate-limit\n    }\n    other => { other?; }\n}","preventionTips":["Parse and record the numeric status code for diagnostics.","Apply exponential backoff when codes suggest throttling.","Skip posts whose codes indicate deletion/privacy.","Keep a mapping of TikTok status codes to user-facing messages."],"tags":["tiktok","status-code","api-status","content-unavailable"],"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"}