tonhowtf/omniget · error

pin sem URL de video

Error message

pin sem URL de video

What it means

download_video() collects a video's progressive URLs and HLS manifest; after the loop, if the Video struct has no `hls` URL, it raises "pin sem URL de video" before invoking ffmpeg. The library's video path is HLS-based, so a pin that only exposes progressive MP4 renditions (or no video at all) cannot be downloaded through this function.

Solutions

  1. Check pin.video exists and inspect which fields are populated before choosing video download.
  2. Route image-only pins to fetch_image / download_pin's image path instead.
  3. If the pin only has progressive MP4 URLs, download those directly without ffmpeg/HLS.
  4. Update the library/parser — Pinterest metadata shapes change and hls may now sit under a different key.

Example fix

// before
api.download_video(&pin).await?;
// after
match (&pin.video, &pin.images) {
    (Some(v), _) if v.hls.is_some() => api.download_video(&pin).await?,
    (Some(v), _) if !v.progressive.is_empty() => download_direct(&v.progressive).await?,
    _ => api.download_image(&pin).await?,
}
Defensive patterns

Strategy: type-guard

Validate before calling

fn video_downloadable(v: &Video) -> bool { v.hls.is_some() || !v.progressive.is_empty() }

Type guard

fn has_hls(pin: &Pin) -> Option<&str> { pin.video.as_ref()?.hls.as_deref() }

Try / catch

match api.download_video(&pin).await {
    Err(e) if e.to_string().contains("sem URL de video") => api.download_image(&pin).await?,
    other => other?,
}

Prevention

When it happens

Trigger: Calling download_pin/download_video on a pin whose Video struct lacks an hls field — image-only pins, story-pin/format pins without HLS, or videos Pinterest serves only as progressive files.

Common situations: Calling download_video on regular image pins by mistake; newer Pinterest video formats that omit the HLS manifest; video data stripped by an incomplete parse of the pin JSON.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

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

    if let Some(mp4) = &video.mp4 {
        let resp = client
            .http()
            .get(mp4)
            .header("Referer", "https://www.pinterest.com/")
            .send()
            .await?;
        if resp.status().is_success() {
            let bytes = resp.bytes().await?;
            if bytes.len() > 1024 {
                tokio::fs::write(out, &bytes).await?;
                return Ok(());
            }
        }
    }
    let hls = video
        .hls
        .as_ref()
        .ok_or_else(|| anyhow!("pin sem URL de video"))?;
    let ffmpeg = crate::core::dependencies::ensure_ffmpeg().await?;
    let o = crate::core::process::command(&ffmpeg)
        .args([
            "-y",
            "-hide_banner",
            "-loglevel",
            "error",
            "-user_agent",
            "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 Chrome/130.0.0.0 Safari/537.36",
            "-headers",
            "Referer: https://www.pinterest.com/\r\n",
            "-protocol_whitelist",
            "file,http,https,tcp,tls,crypto",
            "-i",
            hls,
            "-c",
            "copy",
            "-bsf:a",

View on GitHub (pinned to 8600b91f42)