{"record":{"id":"96c0abc4515698ce","repo":"tonhowtf/omniget","slug":"pin-sem-url-de-video","errorCode":null,"errorMessage":"pin sem URL de video","messagePattern":"pin sem URL de video","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/pinterest/media.rs","lineNumber":229,"sourceCode":"    if let Some(mp4) = &video.mp4 {\n        let resp = client\n            .http()\n            .get(mp4)\n            .header(\"Referer\", \"https://www.pinterest.com/\")\n            .send()\n            .await?;\n        if resp.status().is_success() {\n            let bytes = resp.bytes().await?;\n            if bytes.len() > 1024 {\n                tokio::fs::write(out, &bytes).await?;\n                return Ok(());\n            }\n        }\n    }\n    let hls = video\n        .hls\n        .as_ref()\n        .ok_or_else(|| anyhow!(\"pin sem URL de video\"))?;\n    let ffmpeg = crate::core::dependencies::ensure_ffmpeg().await?;\n    let o = crate::core::process::command(&ffmpeg)\n        .args([\n            \"-y\",\n            \"-hide_banner\",\n            \"-loglevel\",\n            \"error\",\n            \"-user_agent\",\n            \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 Chrome/130.0.0.0 Safari/537.36\",\n            \"-headers\",\n            \"Referer: https://www.pinterest.com/\\r\\n\",\n            \"-protocol_whitelist\",\n            \"file,http,https,tcp,tls,crypto\",\n            \"-i\",\n            hls,\n            \"-c\",\n            \"copy\",\n            \"-bsf:a\",","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/pinterest/media.rs#L211-L247","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check pin.video exists and inspect which fields are populated before choosing video download.","Route image-only pins to fetch_image / download_pin's image path instead.","If the pin only has progressive MP4 URLs, download those directly without ffmpeg/HLS.","Update the library/parser — Pinterest metadata shapes change and hls may now sit under a different key."],"exampleFix":"// before\napi.download_video(&pin).await?;\n// after\nmatch (&pin.video, &pin.images) {\n    (Some(v), _) if v.hls.is_some() => api.download_video(&pin).await?,\n    (Some(v), _) if !v.progressive.is_empty() => download_direct(&v.progressive).await?,\n    _ => api.download_image(&pin).await?,\n}","handlingStrategy":"type-guard","validationCode":"fn video_downloadable(v: &Video) -> bool { v.hls.is_some() || !v.progressive.is_empty() }","typeGuard":"fn has_hls(pin: &Pin) -> Option<&str> { pin.video.as_ref()?.hls.as_deref() }","tryCatchPattern":"match api.download_video(&pin).await {\n    Err(e) if e.to_string().contains(\"sem URL de video\") => api.download_image(&pin).await?,\n    other => other?,\n}","preventionTips":["Inspect pin.video before choosing the video path","Route image-only pins to the image downloader","Support progressive MP4 fallback for pins without HLS","Keep the parser updated as Pinterest moves the hls field"],"tags":["pinterest","video","hls","missing-data"],"backgroundTag":"missing-required-argument","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}