tonhowtf/omniget · error

esse pin nao tem midia baixavel

Error message

esse pin nao tem midia baixavel

What it means

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.

Solutions

  1. Inspect the pin JSON (enable the sidecar option to dump it) and check what media fields are present
  2. Try a different pin URL form (direct pin id vs full share URL)
  3. Update/patch the Pinterest media parser to handle the new page layout
  4. Skip this pin and report it as unsupported media type

Example fix

null
Defensive patterns

Strategy: try-catch

Try / catch

match download_pin(&opts).await {
    Err(e) if e.to_string().contains("nao tem midia baixavel") => {
        eprintln!("pin sem mídia suportada; pulando");
    }
    Err(e) => eprintln!("erro: {e}"),
    Ok(files) => println!("baixado: {:?}", files),
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/pinterest/media.rs:337

                let path = dir.join(format!("{}{}.mp4", base, suffix));
                download_video(client, v, &path).await?;
                files.push(path.to_string_lossy().to_string());
            }
        } else if opts.images {
            if let Some(m) = &ex.image {
                let (bytes, ext) = fetch_image(client, &m.url).await?;
                let (path, bytes) = save_image(bytes, ext, &suffix)?;
                write_bytes(&path, &bytes).await?;
                files.push(path.to_string_lossy().to_string());
            }
        }
    }
    if opts.sidecar && !files.is_empty() {
        let path = dir.join(format!("{}.json", base));
        write_bytes(&path, serde_json::to_string_pretty(pin)?.as_bytes()).await?;
    }
    if files.is_empty() {
        return Err(anyhow!("esse pin nao tem midia baixavel"));
    }
    Ok(files)
}

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

    #[test]
    fn candidate_chain() {
        let c = candidates(
            "https://i.pinimg.com/originals/3e/57/c1/3e57c1b723b8e9d39b8c09f6c5efbfb0.jpg",
        );
        assert_eq!(
            c[0],
            "https://i.pinimg.com/originals/3e/57/c1/3e57c1b723b8e9d39b8c09f6c5efbfb0.jpg"
        );
        assert!(c.contains(

View on GitHub (pinned to 8600b91f42)