From 8047680799d88521232986e83091b06a5253022b Mon Sep 17 00:00:00 2001 From: bytedream Date: Wed, 19 Jun 2024 23:18:35 +0200 Subject: [PATCH] Add drm check --- crunchy-cli-core/src/utils/video.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crunchy-cli-core/src/utils/video.rs b/crunchy-cli-core/src/utils/video.rs index 8b25791..a15296c 100644 --- a/crunchy-cli-core/src/utils/video.rs +++ b/crunchy-cli-core/src/utils/video.rs @@ -27,6 +27,11 @@ pub async fn stream_data_from_stream( } } .unwrap(); + + if videos.iter().any(|v| v.drm.is_some()) || audios.iter().any(|v| v.drm.is_some()) { + bail!("Stream is DRM protected") + } + videos.sort_by(|a, b| a.bandwidth.cmp(&b.bandwidth).reverse()); audios.sort_by(|a, b| a.bandwidth.cmp(&b.bandwidth).reverse());