{"record":{"id":"9c3772ef61b8783e","repo":"tonhowtf/omniget","slug":"hls-stream-uses-sample-aes-fairplay-drm-cannot-decrypt","errorCode":null,"errorMessage":"HLS stream uses SAMPLE-AES (FairPlay DRM), cannot decrypt","messagePattern":"HLS stream uses SAMPLE-AES \\(FairPlay DRM\\), cannot decrypt","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/hls_downloader.rs","lineNumber":454,"sourceCode":"    async fn fetch_encryption_info(\n        &self,\n        playlist: &m3u8_rs::MediaPlaylist,\n        m3u8_url: &str,\n        referer: &str,\n    ) -> anyhow::Result<Option<EncryptionInfo>> {\n        for segment in &playlist.segments {\n            if let Some(key) = &segment.key {\n                match key.method {\n                    m3u8_rs::KeyMethod::AES128 => {\n                        if let Some(uri) = &key.uri {\n                            let key_url = resolve_url(m3u8_url, uri);\n                            let key_bytes = self.fetch_key_with_retry(&key_url, referer, 3).await?;\n                            let iv = key.iv.as_ref().map(|iv_str| parse_hex_iv(iv_str));\n                            return Ok(Some(EncryptionInfo { key_bytes, iv }));\n                        }\n                    }\n                    m3u8_rs::KeyMethod::SampleAES => {\n                        anyhow::bail!(\"HLS stream uses SAMPLE-AES (FairPlay DRM), cannot decrypt\");\n                    }\n                    _ => {}\n                }\n            }\n        }\n        Ok(None)\n    }\n\n    async fn fetch_key_with_retry(\n        &self,\n        url: &str,\n        referer: &str,\n        max_retries: u32,\n    ) -> anyhow::Result<Vec<u8>> {\n        let mut last_err = None;\n        for attempt in 0..max_retries {\n            let req = apply_referer_headers(self.client.get(url), referer)\n                .header(\"User-Agent\", self.effective_user_agent());","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/hls_downloader.rs#L436-L472","documentation":"Hard stop in fetch_encryption_info: the HLS playlist declares key method SAMPLE-AES, which is Apple FairPlay DRM — only AES-128 with a fetchable key URI is supported, so the stream is undecryptable by design and the download is refused early.","triggerScenarios":"Thrown at src-tauri/omniget-core/src/core/hls_downloader.rs:454 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a non-DRM source or stream variant for the content","Capture via a DRM-aware licensed workflow if you own the content rights","Check for an alternate HLS rendition without SAMPLE-AE encryption"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}