mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
add archive no-closed-captions flag (#323)
This commit is contained in:
parent
982e521e0b
commit
f8309f2e80
2 changed files with 13 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ pub struct DownloadBuilder {
|
|||
subtitle_sort: Option<Vec<Locale>>,
|
||||
force_hardsub: bool,
|
||||
download_fonts: bool,
|
||||
no_closed_caption: bool,
|
||||
threads: usize,
|
||||
ffmpeg_threads: Option<usize>,
|
||||
}
|
||||
|
|
@ -74,6 +75,7 @@ impl DownloadBuilder {
|
|||
subtitle_sort: None,
|
||||
force_hardsub: false,
|
||||
download_fonts: false,
|
||||
no_closed_caption: false,
|
||||
threads: num_cpus::get(),
|
||||
ffmpeg_threads: None,
|
||||
}
|
||||
|
|
@ -91,6 +93,7 @@ impl DownloadBuilder {
|
|||
|
||||
force_hardsub: self.force_hardsub,
|
||||
download_fonts: self.download_fonts,
|
||||
no_closed_caption: self.no_closed_caption,
|
||||
|
||||
download_threads: self.threads,
|
||||
ffmpeg_threads: self.ffmpeg_threads,
|
||||
|
|
@ -124,6 +127,7 @@ pub struct Downloader {
|
|||
|
||||
force_hardsub: bool,
|
||||
download_fonts: bool,
|
||||
no_closed_caption: bool,
|
||||
|
||||
download_threads: usize,
|
||||
ffmpeg_threads: Option<usize>,
|
||||
|
|
@ -266,6 +270,10 @@ impl Downloader {
|
|||
};
|
||||
|
||||
for (subtitle, not_cc) in format.subtitles.iter() {
|
||||
if !not_cc && self.no_closed_caption {
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Some(pb) = &progress_spinner {
|
||||
let mut progress_message = pb.message();
|
||||
if !progress_message.is_empty() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue