{"record":{"id":"b317145676f779d3","repo":"tonhowtf/omniget","slug":"no-media-url-available","errorCode":null,"errorMessage":"No media URL available","messagePattern":"No media URL available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/platforms/pinterest.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/omniget-core/src/platforms/pinterest.rs#L217-L253","documentation":"download() takes the first entry of MediaInfo.available_qualities as the media URL to stream. If that list is empty, there is no URL to download and this error is raised. It usually means get_media_info parsed the pin's HTML but found no media assets.","triggerScenarios":"Downloading a pin whose available_qualities is empty — e.g. the HTML contained no extractable video/image URL, extraction regexes missed the current Pinterest page format, or the pin is an idea/story pin type not handled.","commonSituations":"Pinterest changes its HTML/JSON embed format breaking extractors; pin contains only external links; private or age-restricted media that renders an empty page for the scraper; stale cached MediaInfo.","solutions":["Re-run get_media_info to get fresh MediaInfo before downloading","Check the pin in a browser — if it has no direct media, the error is expected","Update/extend the video/image extraction logic to match current Pinterest HTML","Reject the pin earlier with a clearer error in get_media_info when no assets are found"],"exampleFix":"// before\nlet quality = info.available_qualities.first()\n    .ok_or_else(|| anyhow!(\"No media URL available\"))?;\n// after\nlet quality = info.available_qualities.first().with_context(||\n    format!(\"no media URL available for pin (qualities: {:?})\", info.available_qualities.len()))?;","handlingStrategy":"validation","validationCode":"fn has_media(info: &MediaInfo) -> bool {\n    !info.available_qualities.is_empty()\n}","typeGuard":null,"tryCatchPattern":"if !has_media(&info) {\n    return Err(anyhow!(\"pin has no downloadable media — check it in a browser\"));\n}\nplatform.download(opts).await?;","preventionTips":["Call get_media_info immediately before download; never reuse stale MediaInfo","Verify the pin actually contains media before attempting download","Keep extractors updated against current Pinterest markup","Surface empty quality lists earlier with a clearer error at get_media_info time"],"tags":["pinterest","scraping","empty-result","download"],"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"}