Add forced flag to all CC subtitles (#274)

This commit is contained in:
bytedream 2023-12-10 13:52:33 +01:00
parent b97c2a922e
commit 8613ea80cc

View file

@ -434,12 +434,23 @@ impl Downloader {
{ {
command_args.extend([ command_args.extend([
format!("-disposition:s:s:{}", position), format!("-disposition:s:s:{}", position),
"forced".to_string(), "default".to_string(),
]) ])
} }
} }
} }
// set the 'forced' flag to CC subtitles
for (i, subtitle) in subtitles.iter().enumerate() {
// well, checking if the title contains '(CC)' might not be the best solutions from a
// performance perspective but easier than adjusting the `FFmpegMeta` struct
if !subtitle.title.contains("(CC)") {
continue;
}
command_args.extend([format!("-disposition:s:s:{}", i), "forced".to_string()])
}
command_args.extend(output_presets); command_args.extend(output_presets);
if let Some(output_format) = self.output_format { if let Some(output_format) = self.output_format {
command_args.extend(["-f".to_string(), output_format]); command_args.extend(["-f".to_string(), output_format]);