Enable stdout output

This commit is contained in:
ByteDream 2023-03-23 13:39:05 +01:00
parent a7adb7191e
commit ba1c0aaaa4
4 changed files with 20 additions and 8 deletions

View file

@ -317,7 +317,12 @@ impl Downloader {
let progress_handler = progress!("Generating output file");
let ffmpeg = Command::new("ffmpeg")
.stdout(Stdio::null())
// pass ffmpeg stdout to real stdout only if output file is stdout
.stdout(if dst.to_str().unwrap() == "-" {
Stdio::inherit()
} else {
Stdio::null()
})
.stderr(Stdio::piped())
.args(command_args)
.output()?;

View file

@ -223,12 +223,12 @@ impl Format {
pub fn visual_output(&self, dst: &Path) {
info!(
"Downloading {} to '{}'",
"Downloading {} to {}",
self.title,
if is_special_file(&dst) {
dst.to_str().unwrap()
if is_special_file(&dst) || dst.to_str().unwrap() == "-" {
dst.to_string_lossy().to_string()
} else {
dst.file_name().unwrap().to_str().unwrap()
format!("'{}'", dst.to_str().unwrap())
}
);
tab_info!(