{"record":{"id":"3aeeef0bbd475f4d","repo":"tonhowtf/omniget","slug":"nao-entendi-o-destino-de-pin-it","errorCode":null,"errorMessage":"nao entendi o destino de pin.it/{}","messagePattern":"nao entendi o destino de pin\\.it/(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/pinterest/api.rs","lineNumber":1326,"sourceCode":"                    username: username.clone(),\n                },\n                format!(\"{} (criados)\", username),\n            )),\n            Target::Search { query, scope } => Ok((\n                Feed::Search {\n                    query: query.clone(),\n                    scope: scope.clone(),\n                },\n                query.clone(),\n            )),\n            Target::Pin { id } => Ok((\n                Feed::Related { pin_id: id.clone() },\n                format!(\"parecidos com {}\", id),\n            )),\n            Target::Short { code } => {\n                let url = self.resolve_short(code).await?;\n                let t = parse_target(&url)\n                    .ok_or_else(|| anyhow!(\"nao entendi o destino de pin.it/{}\", code))?;\n                Box::pin(self.feed_for(&t)).await\n            }\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn parses_targets() {\n        assert_eq!(\n            parse_target(\"https://www.pinterest.com/pin/8373949304441833/\"),\n            Some(Target::Pin {\n                id: \"8373949304441833\".into()\n            })\n        );","sourceCodeStart":1308,"sourceCodeEnd":1344,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/pinterest/api.rs#L1308-L1344","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Attach session cookies so deleted/auth-walled links don't bounce to a login or home page.","Open the pin.it link in a browser and use the full pinterest.com/pin/<id>/ URL instead.","Check what the redirect destination actually is (log resolve_short's return) and handle new URL shapes.","Retry — occasional A/B interstitials may redirect oddly."],"exampleFix":"// before\nlet feed = api.feed_for(&Target::Short { code }).await?;\n// after\nlet feed = api.feed_for(&Target::Short { code: code.clone() }).await\n    .map_err(|e| { log::warn!(\"unparseable pin.it/{code} destination: {e}\"); e })?;","handlingStrategy":"fallback","validationCode":"// Only attempt short targets for well-formed pin.it codes\nfn plausible_code(code: &str) -> bool { !code.is_empty() && code.len() <= 32 && !code.contains('/') }","typeGuard":"null","tryCatchPattern":"match api.feed_for(&Target::Short { code }).await {\n    Ok(f) => f,\n    Err(e) if e.to_string().contains(\"nao entendi o destino\") => {\n        ask_full_url(code) // dead pin redirected to home/login\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep session cookies so redirects land on real content, not login walls","Log resolve_short output to see actual destinations","Prefer canonical pin URLs over short links","Handle Pinterest's localized domains when parsing targets"],"tags":["pinterest","short-link","parse-failure","redirect"],"backgroundTag":"unexpected-response-shape","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}