{"record":{"id":"39d089b28eaa71ea","repo":"tonhowtf/omniget","slug":"downloaded-streams-are-drm-protected-and-cannot-be-merged","errorCode":null,"errorMessage":"Downloaded streams are DRM-protected and cannot be merged. This content is not supported.","messagePattern":"Downloaded streams are DRM-protected and cannot be merged\\. This content is not supported\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/ytdlp.rs","lineNumber":4447,"sourceCode":"        return anyhow!(\"Server returned error 429 (too many requests). Try again later.\");\n    }\n    if lower.contains(\"http error 403\") || lower.contains(\"forbidden\") {\n        return anyhow!(\"Access denied (403). The video may be private or region-restricted.\");\n    }\n    if lower.contains(\"sign in to confirm\")\n        || lower.contains(\"login required\")\n        || stderr.contains(\"请先登录\")\n        || stderr.contains(\"需要登录\")\n        || stderr.contains(\"登录后可\")\n        || stderr.contains(\"仅登录用户\")\n        || lower.contains(\"this video is only available\") && lower.contains(\"members\")\n    {\n        return anyhow!(\n            \"This video requires login. Import cookies for this site in Settings → Cookies, then retry.\"\n        );\n    }\n    if lower.contains(\"invalid data found when processing input\") {\n        return anyhow!(\n            \"Downloaded streams are DRM-protected and cannot be merged. This content is not supported.\"\n        );\n    }\n    if lower.contains(\"nsig extraction failed\") || lower.contains(\"nsig\") {\n        return anyhow!(\"Video extraction failed. Update yt-dlp or try again.\");\n    }\n    if lower.contains(\"cannot parse data\")\n        || lower.contains(\"please report this issue\")\n        || (lower.contains(\"confirm you are on the latest version\") && lower.contains(\"yt-dlp\"))\n    {\n        return anyhow!(\n            \"yt-dlp extractor is broken for this site. Update yt-dlp in Settings → Dependencies, then retry.\"\n        );\n    }\n    if lower.contains(\"requested format\") && lower.contains(\"not available\") {\n        return anyhow!(\n            \"Requested format is not available. The download will retry with a compatible format.\"\n        );","sourceCodeStart":4429,"sourceCodeEnd":4465,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/ytdlp.rs#L4429-L4465","documentation":"translate_ytdlp_error at ytdlp.rs:4447 maps the stderr pattern 'invalid data found when processing input' to this message. yt-dlp (via ffmpeg) received stream bytes it cannot parse, which in this pipeline indicates DRM-protected media that cannot be decrypted or merged. The library throws it to declare the content unsupported rather than retrying.","triggerScenarios":"During merge/post-processing, ffmpeg reports 'invalid data found when processing input' — encountered when the downloaded audio/video streams are DRM-protected (e.g. Widevine-protected manifests served instead of clear streams).","commonSituations":"Attempting to download DRM-protected streaming-service content (Netflix, Disney+, some licensed YouTube movie rentals) where yt-dlp fetches encrypted segments; subscribing to a format that is actually encrypted CENC data.","solutions":["Accept that the content is not supported; DRM cannot be circumvented by this tool.","Check for a non-DRM format/variant of the same media and download that instead.","If you believe the media is NOT DRM-protected, update yt-dlp and retry — occasional site changes can mislabel formats."],"exampleFix":"// before: request 'best' which may pick a DRM-protected manifest\nlet out = run_ytdlp(&[\"-f\", \"best\", url])?;\n\n// after: restrict to clear (non-DRM) formats\nlet out = run_ytdlp(&[\"-f\", \"best[format_note!*=DRM]/best\", url])?;","handlingStrategy":"fallback","validationCode":"// Inspect the manifest for DRM signals before downloading\nconst manifest = await probeFormats(url);\nconst drm = manifest.formats.some(f => /drm|widevine|playready|fairplay/i.test(f.format_note || f.protocol || ''));\nif (drm) throw new Error('DRM-protected content — not supported, abort before download.');","typeGuard":null,"tryCatchPattern":"try {\n  await download(url, '-f best');\n} catch (e) {\n  if (isDrmError(e)) reportUnsupported(url); // do not retry DRM content\n  else throw e;\n}","preventionTips":["Prefer explicit non-DRM format selectors when a site mixes clear and encrypted streams","Treat DRM errors as terminal — never loop retries on protected media","Stick to sources known to serve clear streams"],"tags":["drm","ffmpeg","unsupported-content","ytdlp"],"backgroundTag":"unsupported-operation","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"}