{"record":{"id":"edc03537cc473bfa","repo":"tonhowtf/omniget","slug":"esse-pin-nao-tem-midia-baixavel","errorCode":null,"errorMessage":"esse pin nao tem midia baixavel","messagePattern":"esse pin nao tem midia baixavel","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/pinterest/media.rs","lineNumber":337,"sourceCode":"                let path = dir.join(format!(\"{}{}.mp4\", base, suffix));\n                download_video(client, v, &path).await?;\n                files.push(path.to_string_lossy().to_string());\n            }\n        } else if opts.images {\n            if let Some(m) = &ex.image {\n                let (bytes, ext) = fetch_image(client, &m.url).await?;\n                let (path, bytes) = save_image(bytes, ext, &suffix)?;\n                write_bytes(&path, &bytes).await?;\n                files.push(path.to_string_lossy().to_string());\n            }\n        }\n    }\n    if opts.sidecar && !files.is_empty() {\n        let path = dir.join(format!(\"{}.json\", base));\n        write_bytes(&path, serde_json::to_string_pretty(pin)?.as_bytes()).await?;\n    }\n    if files.is_empty() {\n        return Err(anyhow!(\"esse pin nao tem midia baixavel\"));\n    }\n    Ok(files)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn candidate_chain() {\n        let c = candidates(\n            \"https://i.pinimg.com/originals/3e/57/c1/3e57c1b723b8e9d39b8c09f6c5efbfb0.jpg\",\n        );\n        assert_eq!(\n            c[0],\n            \"https://i.pinimg.com/originals/3e/57/c1/3e57c1b723b8e9d39b8c09f6c5efbfb0.jpg\"\n        );\n        assert!(c.contains(","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/pinterest/media.rs#L319-L355","documentation":"download_pin collects downloaded files into `files` and, after processing images/video (and optional sidecar JSON), finds the list empty and fails. This means the pin resolved successfully but contained no media this downloader could fetch — the function guarantees it never silently returns an empty result set.","triggerScenarios":"Calling download_pin (via live_download_image_and_video) on a pin that has no image or video variants (e.g. an idea-pin/story variant unsupported by the parser, a text-only pin, or a pin whose media URLs were stripped/failed to parse).","commonSituations":"Pinterest page-shape changes that break media extraction, trying to download idea pins or story pins, deleted media that still resolves as a pin object, or scraping a pin that only contains embedded external links.","solutions":["Inspect the pin JSON (enable the sidecar option to dump it) and check what media fields are present","Try a different pin URL form (direct pin id vs full share URL)","Update/patch the Pinterest media parser to handle the new page layout","Skip this pin and report it as unsupported media type"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match download_pin(&opts).await {\n    Err(e) if e.to_string().contains(\"nao tem midia baixavel\") => {\n        eprintln!(\"pin sem mídia suportada; pulando\");\n    }\n    Err(e) => eprintln!(\"erro: {e}\"),\n    Ok(files) => println!(\"baixado: {:?}\", files),\n}","preventionTips":["Enable the sidecar option to dump the pin JSON when diagnosing","Skip idea-pin/story-pin URLs the parser doesn't support","Keep the Pinterest parser updated against page-layout changes"],"tags":["pinterest","scraper","empty-result","rust"],"backgroundTag":"empty-result-set","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"}