mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Add options to get drm dash and hls url with search
This commit is contained in:
parent
18f891efd2
commit
b477ca982c
2 changed files with 22 additions and 8 deletions
|
|
@ -87,7 +87,9 @@ pub struct Search {
|
||||||
///
|
///
|
||||||
/// stream.locale → Stream locale/language
|
/// stream.locale → Stream locale/language
|
||||||
/// stream.dash_url → Stream url in DASH format
|
/// 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.hls_url → Stream url in HLS format
|
||||||
|
/// stream.drm_hls_url → Stream url in DRM protected HLS format
|
||||||
///
|
///
|
||||||
/// subtitle.locale → Subtitle locale/language
|
/// subtitle.locale → Subtitle locale/language
|
||||||
/// subtitle.url → Url to the subtitle
|
/// subtitle.url → Url to the subtitle
|
||||||
|
|
|
||||||
|
|
@ -163,25 +163,37 @@ impl From<&Concert> for FormatConcert {
|
||||||
struct FormatStream {
|
struct FormatStream {
|
||||||
pub locale: Locale,
|
pub locale: Locale,
|
||||||
pub dash_url: String,
|
pub dash_url: String,
|
||||||
|
pub drm_dash_url: String,
|
||||||
pub hls_url: String,
|
pub hls_url: String,
|
||||||
|
pub drm_hls_url: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<&Stream> for FormatStream {
|
impl From<&Stream> for FormatStream {
|
||||||
fn from(value: &Stream) -> Self {
|
fn from(value: &Stream) -> Self {
|
||||||
let (dash_url, hls_url) = value.variants.get(&Locale::Custom("".to_string())).map_or(
|
let (dash_url, drm_dash_url, hls_url, drm_hls_url) =
|
||||||
("".to_string(), "".to_string()),
|
value.variants.get(&Locale::Custom("".to_string())).map_or(
|
||||||
|v| {
|
|
||||||
(
|
(
|
||||||
v.adaptive_dash.clone().unwrap_or_default().url,
|
"".to_string(),
|
||||||
v.adaptive_hls.clone().unwrap_or_default().url,
|
"".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 {
|
Self {
|
||||||
locale: value.audio_locale.clone(),
|
locale: value.audio_locale.clone(),
|
||||||
dash_url,
|
dash_url,
|
||||||
|
drm_dash_url,
|
||||||
hls_url,
|
hls_url,
|
||||||
|
drm_hls_url,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue