{"record":{"id":"296e0b2e1245410c","repo":"tonhowtf/omniget","slug":"ffmpeg-falhou","errorCode":null,"errorMessage":"ffmpeg falhou: {}{}","messagePattern":"ffmpeg falhou: (.+?)(.+?)","errorType":"exception","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/manifest_dl.rs","lineNumber":158,"sourceCode":"                if !line.trim().is_empty() {\n                    tail = line;\n                }\n            }\n        }\n        tail\n    });\n    let st = child.wait().await?;\n    let secs = t1.await.unwrap_or(0.0);\n    let tail = t2.await.unwrap_or_default();\n    if !st.success() {\n        let hint = if tail.contains(\"403\") || tail.contains(\"401\") {\n            \" (o servidor recusou: falta Referer/cookie ou o link expirou)\"\n        } else if tail.to_lowercase().contains(\"drm\") || tail.contains(\"cenc\") {\n            \" (conteudo com DRM nao e suportado)\"\n        } else {\n            \"\"\n        };\n        return Err(anyhow!(\"ffmpeg falhou: {}{}\", tail, hint));\n    }\n    super::report(&progress, &id, \"done\", secs as u64, Some(secs as u64), None);\n    Ok(ManifestResult {\n        path: out.to_string_lossy().to_string(),\n        seconds: secs,\n    })\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn builds_headers() {\n        let o = ManifestOptions {\n            url: \"\".into(),\n            dest_dir: \"\".into(),\n            file_name: \"\".into(),","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/manifest_dl.rs#L140-L176","documentation":"When the spawned ffmpeg process exits with a non-zero status, download inspects the tail of ffmpeg's stderr for known patterns (auth/Referer issues, DRM markers like 'drm'/'cenc') and attaches a human-readable hint, then raises this error. The raw ffmpeg output tail is embedded so the real cause is visible.","triggerScenarios":"ffmpeg fails for any reason while downloading/remuxing the manifest: 403 from the CDN (missing Referer/cookies or expired link), DRM-protected DASH content (cenc), bad manifest URL, missing codecs, disk/permission errors in dest_dir, or ffmpeg crashing mid-download.","commonSituations":"HLS/DASH link that expired between copying and downloading; geo-blocked or token-signed URLs; Widevine/PlayReady-protected MPD (ffmpeg cannot decrypt DRM); corporate proxy blocking segment downloads; corrupted ffmpeg install.","solutions":["Read the tail in the message: if it mentions 403/refusal, re-copy a fresh manifest URL and pass the needed Referer/headers","If the hint says DRM, the content is not downloadable — use an official download/offline option instead","Re-fetch the manifest URL (signed links expire quickly) and retry immediately","Verify ffmpeg works standalone (ffmpeg -version) and try the URL manually to see full output","Check dest_dir permissions and free disk space"],"exampleFix":"// before\nlet url = \"https://cdn.example.com/manifest.mpd?token=OLD\"; // expired\n// after\nlet url = \"https://cdn.example.com/manifest.mpd?token=FRESH\"; // re-copied just before download","handlingStrategy":"try-catch","validationCode":"// preflight: fail fast on DRM before invoking the tool\nlet body = reqwest::get(&opts.url).await?.text().await?;\nif body.contains(\"cenc:\") || body.contains(\"ContentProtection\") {\n    return Err(\"DRM-protected content is not supported\");\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = manifest_dl::download(&opts, &progress).await {\n    let msg = e.to_string();\n    if msg.contains(\"recusou\") {\n        // re-fetch fresh signed URL / add Referer+cookies, then retry once\n    } else if msg.contains(\"DRM\") {\n        // tell user DRM content can't be downloaded\n    } else {\n        // log full ffmpeg tail and surface it\n    }\n}","preventionTips":["Download signed/HLS links promptly — they expire quickly","Check the MPD for ContentProtection/cenc markers to skip DRM content up front","Ensure Referer/cookie headers are supplied for token-signed streams","Keep ffmpeg up to date and test with ffmpeg -version"],"tags":["ffmpeg","drm","http-403","manifest-download","process-failure"],"backgroundTag":"upstream-api-error","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"}