tonhowtf/omniget · warning

nao encontrado no X (ou o post e privado)

Error message

nao encontrado no X (ou o post e privado)

What it means

FxTwitter returned code 404 (or the HTTP status defaulted to 404), so fx.rs maps it to this explicit not-found error. It distinguishes 'the tweet/user does not exist' from 'it exists but is private', though both are reported together.

Solutions

  1. Validate the tweet ID / handle before calling (ID should be all digits; handle should match ^[A-Za-z0-9_]{1,15}$).
  2. Confirm the post still exists by opening the x.com URL in a logged-out browser.
  3. Check that the input was a full URL parsed to the correct status ID segment.
  4. If the content should exist, retry later — suspension/geo states can change.

Example fix

// before
let id = url.split('/').last().unwrap();
status(id).await?;
// after
let id = url.trim_end_matches('/').rsplit('/').next().unwrap();
if !id.chars().all(|c| c.is_ascii_digit()) {
    return Err(anyhow!("ID de post invalido: {}", id));
}
status(id).await?;
Defensive patterns

Strategy: validation

Validate before calling

fn validate_post_id(id: &str) -> Result<(), String> {
    if id.is_empty() || !id.chars().all(|c| c.is_ascii_digit()) {
        return Err(format!("ID de post deve ser numerico, recebi: {id}"));
    }
    Ok(())
}
fn validate_handle(h: &str) -> Result<(), String> {
    let h = h.trim_start_matches('@');
    if h.len() <= 15 && h.chars().all(|c| c.is_ascii_alphanumeric() || c == '_') { Ok(()) } else { Err(format!("handle invalido: {h}")) }
}

Try / catch

match fx::status(&id).await {
    Ok(p) => p,
    Err(e) if e.to_string().contains("nao encontrado no X") => {
        eprintln!("post {id} nao existe ou e privado — pulando");
        return Ok(None); // skip, don't retry
    }
    Err(e) => return Err(e.into()),
}

Prevention

When it happens

Trigger: Calling status/thread/conversation/profile/profile_statuses/profile_media with a deleted or never-existing tweet ID, a mistyped handle, or an ID that FxTwitter cannot resolve.

Common situations: Typos or truncation in tweet IDs/URLs; deleted posts; suspended accounts; extracting the wrong path segment from a pasted X URL; regional/geo-blocked content returning 404.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/x/fx.rs:52

        .iter()
        .filter(|(_, v)| !v.is_empty())
        .map(|(k, v)| (*k, v.as_str()))
        .collect();
    if !q.is_empty() {
        req = req.query(&q);
    }
    let resp = req.send().await?;
    let status = resp.status();
    let body: Value = resp
        .json()
        .await
        .map_err(|e| anyhow!("FxTwitter: resposta invalida ({})", e))?;
    let code = body
        .get("code")
        .and_then(|c| c.as_u64())
        .unwrap_or(status.as_u16() as u64);
    if code == 404 {
        return Err(anyhow!("nao encontrado no X (ou o post e privado)"));
    }
    if code == 401 {
        return Err(anyhow!("post ou perfil privado"));
    }
    if code == 429 {
        return Err(anyhow!(
            "FxTwitter: limite de requisicoes atingido, tente de novo em instantes"
        ));
    }
    if code >= 400 {
        let msg = body
            .get("message")
            .and_then(|m| m.as_str())
            .unwrap_or("erro");
        return Err(anyhow!("FxTwitter: {} ({})", msg, code));
    }
    Ok(body)
}

View on GitHub (pinned to 8600b91f42)