tonhowtf/omniget · error

No media found in pin

Error message

No media found in pin {}

What it means

native_get_media_info in the Pinterest platform module parsed the pin's media list but none of its entries matched the expected image/video shapes, so it fell through to a generic anyhow error. The library throws this when a pin exists but contains no downloadable media object (or an unrecognized media shape).

Solutions

  1. Open the pin URL in a browser to confirm it actually has downloadable media; skip idea/story pins which this parser does not support.
  2. Log the raw pin JSON before parsing and extend parse_media to handle the missing media shape (e.g. 'carousel_data' or 'story_pin_data').
  3. Check that the pin_id extracted from the URL is correct and not a board/slug fragment.
  4. Update the app: newer versions may already cover the new Pinterest pin schema.
  5. Surface a user-facing 'pin has no downloadable media' message instead of retrying.

Example fix

// before
let media = Self::parse_media(&data).ok_or_else(|| anyhow!("No media found in pin {}", pin_id))?;
// after
let media = Self::parse_media(&data).ok_or_else(|| {
    tracing::debug!("pin {} json: {}", pin_id, serde_json::to_string(&data).unwrap_or_default());
    anyhow!("Pin {} has no supported media (idea/story pins are not downloadable)", pin_id)
})?;
Defensive patterns

Strategy: validation

Validate before calling

// before calling get_media_info
let is_idea_or_story_pin = data.pointer("/story_pin_data").is_some()
    || data.pointer("/media") .map(|m| m.get("images").is_none() && m.get("video").is_none()).unwrap_or(true);
if is_idea_or_story_pin { return Err("pin has no downloadable media"); }

Type guard

fn has_downloadable_media(pin: &serde_json::Value) -> bool {
    pin.pointer("/images").map(|v| v.as_object().map_or(false, |o| !o.is_empty())).unwrap_or(false)
        || pin.pointer("/video_list").map(|v| v.as_array().map_or(false, |a| !a.is_empty())).unwrap_or(false)
}

Try / catch

match get_media_info(url).await {
    Err(e) if e.to_string().contains("No media found in pin") => skip_pin_with_notice(url),
    Err(e) => return Err(e),
    Ok(info) => download(info).await?,
}

Prevention

When it happens

Trigger: Calling get_media_info on a Pinterest pin whose media list is empty, or whose media entries have a type/URL structure the parser does not recognize (e.g. idea pins, story pins, or pins whose 'media' field only carries metadata without image/video URLs).

Common situations: Pinning a text-only or repinned idea pin; Pinterest API returning a pin shape without 'images'/'video_list' for newer pin types; a deleted or region-restricted pin whose media was stripped; API schema drift after Pinterest changes the response format.

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/4b41836004567c52. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/src/platforms/pinterest/mod.rs:324

            return Ok(MediaInfo {
                title: format!("pinterest_{}", pin_id),
                author: String::new(),
                platform: "pinterest".to_string(),
                duration_seconds: None,
                thumbnail_url: None,
                available_qualities: vec![VideoQuality {
                    label: "original".to_string(),
                    width: 0,
                    height: 0,
                    url: image_url,
                    format: format.to_string(),
                }],
                media_type,
                file_size_bytes: None,
            });
        }

        Err(anyhow!("No media found in pin {}", pin_id))
    }
}

View on GitHub (pinned to 8600b91f42)