mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
parent
17233f2fd2
commit
685ac85857
3 changed files with 45 additions and 23 deletions
|
|
@ -74,6 +74,10 @@ pub struct Download {
|
|||
#[arg(value_parser = FFmpegPreset::parse)]
|
||||
ffmpeg_preset: Vec<FFmpegPreset>,
|
||||
|
||||
#[arg(help = "Skip files which are already existing")]
|
||||
#[arg(long, default_value_t = false)]
|
||||
skip_existing: bool,
|
||||
|
||||
#[arg(help = "Ignore interactive input")]
|
||||
#[arg(short, long, default_value_t = false)]
|
||||
yes: bool,
|
||||
|
|
@ -209,17 +213,24 @@ impl Execute for Download {
|
|||
}
|
||||
|
||||
for format in formats {
|
||||
let path = free_file(
|
||||
format.format_path(
|
||||
if self.output.is_empty() {
|
||||
"{title}.mkv"
|
||||
} else {
|
||||
&self.output
|
||||
}
|
||||
.into(),
|
||||
true,
|
||||
),
|
||||
let formatted_path = format.format_path(
|
||||
if self.output.is_empty() {
|
||||
"{title}.mkv"
|
||||
} else {
|
||||
&self.output
|
||||
}
|
||||
.into(),
|
||||
true,
|
||||
);
|
||||
let (path, changed) = free_file(formatted_path.clone());
|
||||
|
||||
if changed && self.skip_existing {
|
||||
debug!(
|
||||
"Skipping already existing file '{}'",
|
||||
formatted_path.to_string_lossy()
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
info!(
|
||||
"Downloading {} to '{}'",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue