diff --git a/crunchy-cli-core/src/search/command.rs b/crunchy-cli-core/src/search/command.rs index 0159c05..1ec4cb9 100644 --- a/crunchy-cli-core/src/search/command.rs +++ b/crunchy-cli-core/src/search/command.rs @@ -87,7 +87,9 @@ pub struct Search { /// /// stream.locale → Stream locale/language /// stream.dash_url → Stream url in DASH format + /// stream.drm_dash_url → Stream url in DRM protected DASH format /// stream.hls_url → Stream url in HLS format + /// stream.drm_hls_url → Stream url in DRM protected HLS format /// /// subtitle.locale → Subtitle locale/language /// subtitle.url → Url to the subtitle diff --git a/crunchy-cli-core/src/search/format.rs b/crunchy-cli-core/src/search/format.rs index 3574597..55cba7c 100644 --- a/crunchy-cli-core/src/search/format.rs +++ b/crunchy-cli-core/src/search/format.rs @@ -163,25 +163,37 @@ impl From<&Concert> for FormatConcert { struct FormatStream { pub locale: Locale, pub dash_url: String, + pub drm_dash_url: String, pub hls_url: String, + pub drm_hls_url: String, } impl From<&Stream> for FormatStream { fn from(value: &Stream) -> Self { - let (dash_url, hls_url) = value.variants.get(&Locale::Custom("".to_string())).map_or( - ("".to_string(), "".to_string()), - |v| { + let (dash_url, drm_dash_url, hls_url, drm_hls_url) = + value.variants.get(&Locale::Custom("".to_string())).map_or( ( - v.adaptive_dash.clone().unwrap_or_default().url, - v.adaptive_hls.clone().unwrap_or_default().url, - ) - }, - ); + "".to_string(), + "".to_string(), + "".to_string(), + "".to_string(), + ), + |v| { + ( + v.adaptive_dash.clone().unwrap_or_default().url, + v.drm_adaptive_dash.clone().unwrap_or_default().url, + v.adaptive_hls.clone().unwrap_or_default().url, + v.drm_adaptive_hls.clone().unwrap_or_default().url, + ) + }, + ); Self { locale: value.audio_locale.clone(), dash_url, + drm_dash_url, hls_url, + drm_hls_url, } } }