{"record":{"id":"cea6d02d465cf709","repo":"tonhowtf/omniget","slug":"post-ou-perfil-privado","errorCode":null,"errorMessage":"post ou perfil privado","messagePattern":"post ou perfil privado","errorType":"exception","errorClass":null,"httpStatus":401,"severity":"warning","filePath":"src-tauri/omniget-core/src/core/tools/x/fx.rs","lineNumber":55,"sourceCode":"        .collect();\n    if !q.is_empty() {\n        req = req.query(&q);\n    }\n    let resp = req.send().await?;\n    let status = resp.status();\n    let body: Value = resp\n        .json()\n        .await\n        .map_err(|e| anyhow!(\"FxTwitter: resposta invalida ({})\", e))?;\n    let code = body\n        .get(\"code\")\n        .and_then(|c| c.as_u64())\n        .unwrap_or(status.as_u16() as u64);\n    if code == 404 {\n        return Err(anyhow!(\"nao encontrado no X (ou o post e privado)\"));\n    }\n    if code == 401 {\n        return Err(anyhow!(\"post ou perfil privado\"));\n    }\n    if code == 429 {\n        return Err(anyhow!(\n            \"FxTwitter: limite de requisicoes atingido, tente de novo em instantes\"\n        ));\n    }\n    if code >= 400 {\n        let msg = body\n            .get(\"message\")\n            .and_then(|m| m.as_str())\n            .unwrap_or(\"erro\");\n        return Err(anyhow!(\"FxTwitter: {} ({})\", msg, code));\n    }\n    Ok(body)\n}\n\nfn s(v: &Value, k: &str) -> String {\n    v.get(k).and_then(|x| x.as_str()).unwrap_or(\"\").to_string()","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/x/fx.rs#L37-L73","documentation":"FxTwitter's API responded with code 401 (or the HTTP status was 401): the requested X/Twitter post or profile is private, so the mirror cannot fetch it without authentication. Raised in get(), which backs every X-related entry point (status, thread, conversation, profile lookups).","triggerScenarios":"Requesting a protected (private-locked) account's profile or profile_statuses, or a tweet from a protected account / a limited-audience reply via get()-backed endpoints.","commonSituations":"Trying to read posts from a private X account; fetching a reply visible only to followers; a formerly public account was set to protected; age-restricted content.","solutions":["Inform the user the content is private and cannot be fetched via FxTwitter.","Use an authenticated X session (the native XClient path) if credentials for an authorized follower exist.","Verify whether the account is protected before making repeated attempts.","Do not retry — 401 is deterministic for the public API."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match fx::profile(&handle).await {\n    Ok(u) => u,\n    Err(e) if e.to_string().contains(\"post ou perfil privado\") => {\n        eprintln!(\"{handle} e protegido; necessario credenciais autorizadas\");\n        return Ok(None);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Skip known-protected accounts before batch runs","Never retry on this error — it is deterministic for the public API","Route private targets to an authenticated session client when available","Surface a clear 'content is private' message to end users instead of a generic failure"],"tags":["fxtwitter","private-content","authorization","x"],"backgroundTag":"permission-denied","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"}