{"record":{"id":"bb91e3cabf7b1672","repo":"tonhowtf/omniget","slug":"pin-not-found-mod","errorCode":null,"errorMessage":"Pin not found","messagePattern":"Pin not found","errorType":"exception","errorClass":null,"httpStatus":404,"severity":"error","filePath":"src-tauri/src/platforms/pinterest/mod.rs","lineNumber":276,"sourceCode":"}\n\nimpl PinterestDownloader {\n    async fn fallback_ytdlp(&self, url: &str) -> anyhow::Result<MediaInfo> {\n        let ytdlp_path = crate::core::ytdlp::ensure_ytdlp().await?;\n        let json = crate::core::ytdlp::get_video_info(&ytdlp_path, url, &[]).await?;\n        crate::platforms::generic_ytdlp::GenericYtdlpDownloader::parse_video_info(&json)\n    }\n\n    async fn native_get_media_info(&self, url: &str) -> anyhow::Result<MediaInfo> {\n        let canonical = self.resolve_pin_url(url).await?;\n\n        let pin_id =\n            Self::extract_pin_id(&canonical).ok_or_else(|| anyhow!(\"Could not extract pin ID\"))?;\n\n        let html = self.fetch_pin_html(&pin_id).await?;\n\n        if Self::check_pin_not_found(&html) {\n            return Err(anyhow!(\"Pin not found\"));\n        }\n\n        if let Some(video_url) = Self::extract_video_url(&html) {\n            return Ok(MediaInfo {\n                title: format!(\"pinterest_{}\", pin_id),\n                author: String::new(),\n                platform: \"pinterest\".to_string(),\n                duration_seconds: None,\n                thumbnail_url: None,\n                available_qualities: vec![VideoQuality {\n                    label: \"original\".to_string(),\n                    width: 0,\n                    height: 0,\n                    url: video_url,\n                    format: \"mp4\".to_string(),\n                }],\n                media_type: MediaType::Video,\n                file_size_bytes: None,","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/pinterest/mod.rs#L258-L294","documentation":"After fetching the pin HTML, the code checks check_pin_not_found(&html) and bails with 'Pin not found' if Pinterest's page indicates the pin does not exist (removed, private, or never existed). This is an explicit not-found signal from the scraped page content, not an HTTP 404.","triggerScenarios":"native_get_media_info -> fetch_pin_html succeeds (2xx), but the returned HTML contains Pinterest's not-found markers detected by check_pin_not_found — deleted pin, private/restricted pin, region-blocked pin, or a soft-404 page.","commonSituations":"User shares a link to a pin that was deleted; pin is on a private board; Pinterest serves a 200 'sorry/limit' page to bots that matches the not-found heuristics; region-locked content rendering an empty pin page.","solutions":["Confirm the pin opens in a normal browser with the same URL; if it 404s there, the pin genuinely no longer exists.","Distinguish bot-blocking from real not-found: refine check_pin_not_found to look at specific markers (e.g. 'Sorry! Something went wrong' vs real 404 text).","Retry with different headers/proxy if a valid pin triggers false-positive not-found detection.","Surface a clear user-facing message that the pin is unavailable or private."],"exampleFix":"// before\nif Self::check_pin_not_found(&html) {\n    return Err(anyhow!(\"Pin not found\"));\n}\n// after\nif Self::check_pin_not_found(&html) {\n    return Err(anyhow!(\"Pin {} not found (deleted, private, or blocked)\", pin_id));\n}","handlingStrategy":"try-catch","validationCode":"// Rust: no local pre-check possible (server-side pin state); guard after fetch\nfn pin_unavailable(html: &str) -> bool {\n    html.contains(\"Sorry! Something went wrong\") || html.contains(\"Pin not found\")\n}","typeGuard":null,"tryCatchPattern":"match get_media_info(pin_url).await {\n    Err(e) if e.to_string().contains(\"Pin not found\") => {\n        eprintln!(\"This pin was deleted, is private, or is not available in your region\");\n    }\n    other => other?,\n}","preventionTips":["Check the pin in a browser before assuming an extractor bug","Keep check_pin_not_found markers updated against Pinterest's real error pages","Distinguish true 404 content from soft-block/limit pages to avoid false positives","Cache known-dead pin IDs to skip repeated failed fetches"],"tags":["pinterest","scraping","not-found","http"],"backgroundTag":"resource-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"}