{"record":{"id":"c86c4ca39aa948fb","repo":"tonhowtf/omniget","slug":"perfil-nao-encontrado","errorCode":null,"errorMessage":"perfil nao encontrado","messagePattern":"perfil nao encontrado","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/pinterest/api.rs","lineNumber":994,"sourceCode":"                }\n            }\n            match next {\n                Some(b) if !out.is_empty() => bookmark = Some(b),\n                _ => break,\n            }\n        }\n        Ok(out)\n    }\n\n    pub async fn user(&self, username: &str) -> anyhow::Result<User> {\n        let (data, _) = self\n            .resource(\n                \"User\",\n                json!({ \"username\": username, \"field_set_key\": \"profile\" }),\n                &format!(\"/{}/\", username),\n            )\n            .await?;\n        parse_user(&data).ok_or_else(|| anyhow!(\"perfil nao encontrado\"))\n    }\n\n    pub async fn user_boards(&self, username: &str) -> anyhow::Result<Vec<Board>> {\n        let mut out = Vec::new();\n        let mut bookmark: Option<String> = None;\n        loop {\n            let mut opts = json!({\n                \"username\": username, \"page_size\": 100, \"privacy_filter\": \"all\", \"sort\": \"last_pinned_to\",\n                \"field_set_key\": \"profile_grid_item\", \"filter_stories\": false, \"group_by\": \"visibility\", \"include_archived\": true\n            });\n            if let Some(b) = &bookmark {\n                opts[\"bookmarks\"] = json!([b]);\n            }\n            let (data, next) = self\n                .resource(\"Boards\", opts, &format!(\"/{}/_saved/\", username))\n                .await?;\n            let before = out.len();\n            for v in data.as_array().cloned().unwrap_or_default() {","sourceCodeStart":976,"sourceCodeEnd":1012,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/pinterest/api.rs#L976-L1012","documentation":"api.rs profile() requests a User via Pinterest's UserResource with field_set_key \"profile\" and parses the result. When `parse_user(&data)` returns None — the response contains no usable profile object — the library raises \"perfil nao encontrado\". Typically the account was deleted, suspended, or Pinterest returned a non-profile response (login wall, 404 page).","triggerScenarios":"Calling PinterestApi::profile(username) for a deactivated/suspended/nonexistent username, or when unauthenticated requests get a challenge page instead of profile JSON.","commonSituations":"Following stale usernames in a sync pipeline; accounts renamed or deactivated since last crawl; Pinterest rate-limiting anonymous traffic and serving fallback pages.","solutions":["Confirm the username still exists at pinterest.com/<username>/ in a browser.","Attach valid session cookies so Pinterest returns profile JSON to your client.","Slow down / add retries — anonymous scraping often triggers challenge pages.","Handle as user-not-found upstream and prune dead usernames from your dataset."],"exampleFix":"// before\nlet user = api.profile(&name).await?;\n// after\nlet user = api.profile(&name).await\n    .with_context(|| format!(\"profile lookup failed for {name}\"))?;\n// skip on not-found:\nlet user = match api.profile(&name).await { Ok(u) => u, Err(_) => { prune(&name); continue; } };","handlingStrategy":"try-catch","validationCode":"// Pinterest usernames: 3-30 chars, alphanumerics and underscores\nfn is_valid_username(u: &str) -> bool { (3..=30).contains(&u.len()) && u.chars().all(|c| c.is_ascii_alphanumeric() || c == '_') }","typeGuard":"fn profile_found(u: &Option<User>) -> bool { u.is_some() }","tryCatchPattern":"match api.profile(&name).await {\n    Ok(u) => sync(u),\n    Err(e) if e.to_string().contains(\"perfil nao encontrado\") => deactivate(&name),\n    Err(e) => return Err(e),\n}","preventionTips":["Periodically prune usernames that 404 in the browser","Add retries — anonymous scrapes often hit challenge pages","Keep cookies valid so real profile JSON is returned","Distinguish not-found from transient errors before deleting records"],"tags":["pinterest","not-found","profile","scraping"],"backgroundTag":"user-not-found","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"}