Mark CC subtitle track as CC & grab normal subtitles and CC when using -m audio (#141)

This commit is contained in:
ByteDream 2023-04-17 18:14:54 +02:00
parent c0e2df4804
commit 847c6a1abc
4 changed files with 38 additions and 26 deletions

View file

@ -203,12 +203,14 @@ async fn get_format(
let download_format = DownloadFormat {
video: (video.clone(), single_format.audio.clone()),
audios: vec![(audio, single_format.audio.clone())],
subtitles: subtitle.clone().map_or(vec![], |s| vec![s]),
subtitles: subtitle
.clone()
.map_or(vec![], |s| vec![(s, single_format.audio == Locale::ja_JP)]),
};
let format = Format::from_single_formats(vec![(
single_format.clone(),
video,
subtitle.map_or(vec![], |s| vec![s]),
subtitle.map_or(vec![], |s| vec![(s, single_format.audio == Locale::ja_JP)]),
)]);
Ok((download_format, format))