tonhowtf/omniget · error
isto não é um post: cole o link de uma thread (com…
Error message
isto não é um post: cole o link de uma thread (com /comments/ no meio)
What it means
After optional short-link resolution, resolve_post() matches the parsed Target. Only Target::Post is accepted; any other recognized Reddit target (subreddit, user, etc.) hits the wildcard arm and raises this error telling the user to supply a thread link containing /comments/.
Solutions
- Provide the post permalink containing /comments/ in the path
- Remove any /comment/<id> suffix and use the parent post URL
- Use the raw post id instead of a subreddit or user link
- If the URL is a short link, confirm it redirects to a /comments/ URL, not a subreddit
Example fix
// before resolve_post(&fetcher, "https://www.reddit.com/r/rust/").await?; // subreddit -> error // after resolve_post(&fetcher, "https://www.reddit.com/r/rust/comments/1abcxyz/title/").await?
Defensive patterns
Strategy: validation
Validate before calling
fn looks_like_thread_url(u: &str) -> bool {
u.contains("reddit.com") && u.contains("/comments/")
}
if !looks_like_thread_url(input) && !(input.len() >= 5 && !input.contains('/')) {
eprintln!("input is not a thread link; expected /comments/ URL or post id");
} Type guard
fn is_post_input(s: &str) -> bool {
s.contains("/comments/") || s.starts_with("https://redd.it/") || (s.len() <= 10 && !s.contains('/'))
} Try / catch
match resolve_post(&fetcher, input).await {
Ok((id, sub)) => download(id, sub).await,
Err(e) if e.to_string().contains("nao e um post") => {
eprintln!("{} is not a thread; need a /comments/ URL", input);
}
Err(e) => return Err(e),
} Prevention
- Validate input contains /comments/ (or is a bare id) before calling
- Strip comment permalinks down to the parent post URL
- Never pass subreddit or user URLs to a post-download API
When it happens
Trigger: Calling resolve_post (via run) with a URL/id that parses to a non-post Reddit target — e.g. a subreddit link (r/example), a user page, a comment permalink, or a gallery/collection link.
Common situations: Users paste a subreddit or user URL when asked for a thread; they paste a link to a comment rather than the post; they paste a crosspost or gallery landing page that parse_target classifies as something other than Post.
Understand the failure class
Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.
Related errors
- cole o link de um post do Reddit, de um i.redd.it ou de um…
- o link curto não levou a um post
- isso é um vídeo, não um perfil
- Could not extract post ID
- formato desconhecido
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/15e2ae61c69412a6.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/reddit/thread.rs:808
pub missing: usize,
pub requests: u32,
pub files: Vec<String>,
pub dest: String,
/// Se o arquivamento saiu com a sessão do usuário ou anônimo.
pub used_session: bool,
}
async fn resolve_post(fetcher: &Fetcher, url: &str) -> Result<(String, Option<String>)> {
let mut target = super::parse_target(url)
.ok_or_else(|| anyhow!("cole o link de um post do Reddit (ou o id dele)"))?;
if let Target::Short { url } = &target {
let final_url = fetcher.resolve(url).await?;
target = super::parse_target(&final_url)
.ok_or_else(|| anyhow!("o link curto não levou a um post ({})", final_url))?;
}
match target {
Target::Post { id, subreddit, .. } => Ok((id, subreddit)),
_ => Err(anyhow!(
"isto não é um post: cole o link de uma thread (com /comments/ no meio)"
)),
}
}
/// Abre os "carregar mais" até o teto de requisições. Devolve quantos
/// comentários ficaram de fora.
async fn expand(
fetcher: &Fetcher,
post_id: &str,
sort: &str,
mut mores: Vec<MoreRef>,
flat: &mut Vec<Comment>,
budget: u32,
progress: &ProgressFn,
) -> usize {
let mut missing = 0usize;
let mut used = 0u32;View on GitHub (pinned to 8600b91f42)