tonhowtf/omniget · error

No media URL available

Error message

No media URL available

What it means

download builds the output file from the first entry of info.available_qualities. If that list is empty (Pinterest HTML yielded no video/image URL), first() is None and this error is thrown. It indicates extraction succeeded structurally but produced no downloadable media URL.

Solutions

  1. Check available_qualities.is_empty() before calling download and surface a clearer 'no extractable media' message.
  2. Update the video/image extraction patterns (extract_video_url / image extraction) against current Pinterest HTML.
  3. Inspect the fetched HTML manually for the pin to see which extraction pattern needs updating.
  4. Try alternative extraction sources (Pinterest's JSON-LD, oEmbed, or __NEXT_DATA__ blob) when regex extraction fails.

Example fix

// before
let quality = info
    .available_qualities
    .first()
    .ok_or_else(|| anyhow!("No media URL available"))?;
// after
let quality = info
    .available_qualities
    .iter()
    .find(|q| !q.url.is_empty())
    .ok_or_else(|| anyhow!("No media URL available for '{}' (extraction found no downloadable media)", info.title))?;
Defensive patterns

Strategy: validation

Validate before calling

// Rust: verify extractable media before downloading
if info.available_qualities.is_empty()
    || info.available_qualities.iter().all(|q| q.url.is_empty()) {
    return Err(anyhow!("pin has no downloadable media"));
}

Try / catch

match download(opts).await {
    Err(e) if e.to_string().contains("No media URL available") => {
        eprintln!("Pin contains no downloadable video/image; extractor may be outdated");
    }
    other => other?,
}

Prevention

When it happens

Trigger: download() is called on a MediaInfo whose available_qualities is empty — media extraction found no video or image URL in the pin's HTML (e.g. story pins, GIF-only content, or extraction regex/pattern mismatch after a Pinterest markup change).

Common situations: Pinterest changed its HTML/JSON structure so extractors silently return nothing; pin contains only unsupported media types; fetch returned a shell page requiring JS rendering; pin is age-restricted with media hidden.

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

Appendix: source

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

                    opts.filename_template.as_deref(),
                    opts.referer
                        .as_deref()
                        .or(Some("https://www.pinterest.com/")),
                    opts.cancel_token.clone(),
                    None,
                    opts.concurrent_fragments,
                    false,
                    &[],
                    opts.audio_format.as_deref(),
                )
                .await;
            }
        }

        let quality = info
            .available_qualities
            .first()
            .ok_or_else(|| anyhow!("No media URL available"))?;

        let extension = &quality.format;
        let filename = format!("{}.{}", info.title, extension);
        let safe_filename = sanitize_filename::sanitize(&filename);
        let output_path = opts.output_dir.join(&safe_filename);

        let total_bytes = direct_downloader::download_direct(
            &self.client,
            &quality.url,
            &output_path,
            progress,
            Some(&opts.cancel_token),
        )
        .await?;

        Ok(DownloadResult {
            file_path: output_path,
            file_size_bytes: total_bytes,

View on GitHub (pinned to 8600b91f42)