tonhowtf/omniget · error
o post não veio na resposta (apagado, privado ou id errado)
Error message
o post não veio na resposta (apagado, privado ou id errado)
What it means
fetch_post requests the Reddit post JSON listing and navigates the pointer /0/data/children/0/data; if that path is absent the post is not retrievable, and the error explains the usual causes: deleted post, private post, or wrong id. It's a guard against Reddit returning an empty children array or an unexpected envelope instead of failing with a cryptic None later.
Solutions
- Verify the post id/URL in a browser — confirm the post still exists and is public
- Check the id format (Reddit base-36 id, no URL-encoding issues)
- Retry later if Reddit returned an empty listing transiently (rate limit/edge error)
- Handle authentication if the post requires login to view
Example fix
// before: blind fetch
let post = fetch_post(&fetcher, id).await?;
// after: validate id shape first
if id.len() < 4 || !id.chars().all(|c| c.is_ascii_alphanumeric()) {
return Err(anyhow!("id de post inválido: {}", id));
}
let post = fetch_post(&fetcher, id).await?; Defensive patterns
Strategy: validation
Validate before calling
fn looks_like_reddit_id(id: &str) -> bool {
(4..=12).contains(&id.len())
&& id.chars().all(|c| c.is_ascii_alphanumeric())
} Try / catch
match run(&args).await {
Err(e) if e.to_string().contains("o post não veio") => {
eprintln!("post apagado/privado ou id errado: {e}");
}
other => other?,
} Prevention
- Validate the post id/URL format before calling
- Verify the post opens publicly in a browser before automating downloads
- Treat empty Reddit listings as possibly transient and retry once
When it happens
Trigger: Calling the reddit download run flow with a post id that doesn't exist, was deleted/removed by moderators, is in a private/quarantined subreddit, or a malformed id that yields an empty listing.
Common situations: Typos in the post id, post removed since link was saved, subreddit gone private, Reddit rate-limiting/edge returning an empty listing for valid ids.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/dc541eac769682c5.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/reddit/download.rs:477
if tail.is_empty() {
String::new()
} else {
format!(": {}", tail)
}
));
}
Ok((files, tail))
}
// ───────────────────────── execução ─────────────────────────
async fn fetch_post(fetcher: &Fetcher, id: &str) -> Result<Value> {
let v = fetcher
.get_json(&super::post_json_url(id, "top", 1))
.await?;
v.pointer("/0/data/children/0/data")
.cloned()
.ok_or_else(|| anyhow!("o post não veio na resposta (apagado, privado ou id errado)"))
}
async fn download_direct(
fetcher: &Fetcher,
urls: &[String],
dest: &Path,
base: &str,
progress: &ProgressFn,
) -> Result<Vec<String>> {
let mut files = Vec::new();
let single = urls.len() == 1;
for (idx, url) in urls.iter().enumerate() {
let ext = url
.split(['?', '#'])
.next()
.unwrap_or(url)
.rsplit('.')
.next()View on GitHub (pinned to 8600b91f42)