tonhowtf/omniget · error

nao entendi o destino de pin.it/{}

Error message

nao entendi o destino de pin.it/{}

What it means

For a Target::Short, feed_for() resolves the pin.it link via resolve_short and then runs parse_target on the destination URL. If the redirect landed somewhere parse_target cannot classify as a pin/board/user target, the library raises "nao entendi o destino de pin.it/{}". The redirect happened (contrast with error 603) but pointed at an unexpected Pinterest page (e.g. login, home feed, or a non-pin URL).

Solutions

  1. Attach session cookies so deleted/auth-walled links don't bounce to a login or home page.
  2. Open the pin.it link in a browser and use the full pinterest.com/pin/<id>/ URL instead.
  3. Check what the redirect destination actually is (log resolve_short's return) and handle new URL shapes.
  4. Retry — occasional A/B interstitials may redirect oddly.

Example fix

// before
let feed = api.feed_for(&Target::Short { code }).await?;
// after
let feed = api.feed_for(&Target::Short { code: code.clone() }).await
    .map_err(|e| { log::warn!("unparseable pin.it/{code} destination: {e}"); e })?;
Defensive patterns

Strategy: fallback

Validate before calling

// Only attempt short targets for well-formed pin.it codes
fn plausible_code(code: &str) -> bool { !code.is_empty() && code.len() <= 32 && !code.contains('/') }

Type guard

null

Try / catch

match api.feed_for(&Target::Short { code }).await {
    Ok(f) => f,
    Err(e) if e.to_string().contains("nao entendi o destino") => {
        ask_full_url(code) // dead pin redirected to home/login
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling feed_for(Target::Short{code}) where the pin.it code redirects to pinterest.com home, a login/signup page, or a non-/pin/ /user/ /slug URL that parse_target returns None for.

Common situations: Deleted pins whose pin.it links now redirect to Pinterest home; region redirects to localized domains parse_target doesn't recognize; session-less requests bounced to a login URL.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/pinterest/api.rs:1326

                    username: username.clone(),
                },
                format!("{} (criados)", username),
            )),
            Target::Search { query, scope } => Ok((
                Feed::Search {
                    query: query.clone(),
                    scope: scope.clone(),
                },
                query.clone(),
            )),
            Target::Pin { id } => Ok((
                Feed::Related { pin_id: id.clone() },
                format!("parecidos com {}", id),
            )),
            Target::Short { code } => {
                let url = self.resolve_short(code).await?;
                let t = parse_target(&url)
                    .ok_or_else(|| anyhow!("nao entendi o destino de pin.it/{}", code))?;
                Box::pin(self.feed_for(&t)).await
            }
        }
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn parses_targets() {
        assert_eq!(
            parse_target("https://www.pinterest.com/pin/8373949304441833/"),
            Some(Target::Pin {
                id: "8373949304441833".into()
            })
        );

View on GitHub (pinned to 8600b91f42)