{"record":{"id":"4ca632ce803cc97a","repo":"tonhowtf/omniget","slug":"no-media-url-available-mod","errorCode":null,"errorMessage":"No media URL available","messagePattern":"No media URL available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/pinterest/mod.rs","lineNumber":235,"sourceCode":"                    opts.filename_template.as_deref(),\n                    opts.referer\n                        .as_deref()\n                        .or(Some(\"https://www.pinterest.com/\")),\n                    opts.cancel_token.clone(),\n                    None,\n                    opts.concurrent_fragments,\n                    false,\n                    &[],\n                    opts.audio_format.as_deref(),\n                )\n                .await;\n            }\n        }\n\n        let quality = info\n            .available_qualities\n            .first()\n            .ok_or_else(|| anyhow!(\"No media URL available\"))?;\n\n        let extension = &quality.format;\n        let filename = format!(\"{}.{}\", info.title, extension);\n        let safe_filename = sanitize_filename::sanitize(&filename);\n        let output_path = opts.output_dir.join(&safe_filename);\n\n        let total_bytes = direct_downloader::download_direct(\n            &self.client,\n            &quality.url,\n            &output_path,\n            progress,\n            Some(&opts.cancel_token),\n        )\n        .await?;\n\n        Ok(DownloadResult {\n            file_path: output_path,\n            file_size_bytes: total_bytes,","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/pinterest/mod.rs#L217-L253","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Check available_qualities.is_empty() before calling download and surface a clearer 'no extractable media' message.","Update the video/image extraction patterns (extract_video_url / image extraction) against current Pinterest HTML.","Inspect the fetched HTML manually for the pin to see which extraction pattern needs updating.","Try alternative extraction sources (Pinterest's JSON-LD, oEmbed, or __NEXT_DATA__ blob) when regex extraction fails."],"exampleFix":"// before\nlet quality = info\n    .available_qualities\n    .first()\n    .ok_or_else(|| anyhow!(\"No media URL available\"))?;\n// after\nlet quality = info\n    .available_qualities\n    .iter()\n    .find(|q| !q.url.is_empty())\n    .ok_or_else(|| anyhow!(\"No media URL available for '{}' (extraction found no downloadable media)\", info.title))?;","handlingStrategy":"validation","validationCode":"// Rust: verify extractable media before downloading\nif info.available_qualities.is_empty()\n    || info.available_qualities.iter().all(|q| q.url.is_empty()) {\n    return Err(anyhow!(\"pin has no downloadable media\"));\n}","typeGuard":null,"tryCatchPattern":"match download(opts).await {\n    Err(e) if e.to_string().contains(\"No media URL available\") => {\n        eprintln!(\"Pin contains no downloadable video/image; extractor may be outdated\");\n    }\n    other => other?,\n}","preventionTips":["Alert on extraction success-rate drops (Pinterest markup changes break regexes silently)","Extract from multiple sources (og: tags, JSON-LD, __NEXT_DATA__) with fallbacks","Add regression tests with captured pin HTML fixtures refreshed periodically","Skip pins whose media types are unsupported and report them distinctly"],"tags":["pinterest","scraping","extraction","empty"],"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"}