pass correct parameter to specify output path
This commit is contained in:
parent
038340e391
commit
3ef63c146f
1 changed files with 4 additions and 3 deletions
|
@ -42,19 +42,20 @@ impl Default for NetworkEnv {
|
||||||
.context(format!("Parsing bytes from body of response for {}", url))
|
.context(format!("Parsing bytes from body of response for {}", url))
|
||||||
}),
|
}),
|
||||||
download_as_mp3: Box::new(|url, channel_name| {
|
download_as_mp3: Box::new(|url, channel_name| {
|
||||||
|
println!("Downloading: {}", url);
|
||||||
let cmd = "yt-dlp";
|
let cmd = "yt-dlp";
|
||||||
let output = Command::new(cmd)
|
let output = Command::new(cmd)
|
||||||
.arg("--extract-audio")
|
.arg("--extract-audio")
|
||||||
.arg("--audio-format")
|
.arg("--audio-format")
|
||||||
.arg("mp3")
|
.arg("mp3")
|
||||||
.arg("-p")
|
.arg("-P")
|
||||||
.arg(format!("~/Music/{}", channel_name))
|
.arg(format!("~/Music/{}", channel_name))
|
||||||
.arg(&url.0)
|
.arg(&url.0)
|
||||||
.output()
|
.output()
|
||||||
.with_context(|| {
|
.with_context(|| {
|
||||||
format!(
|
format!(
|
||||||
"Running: {} --extract-audio --audio-format mp3 {}",
|
"Running: {} --extract-audio --audio-format mp3 -p ~/Music/{} {}",
|
||||||
cmd, url
|
cmd, channel_name, url
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
if !output.stderr.is_empty() {
|
if !output.stderr.is_empty() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue