mirror of
https://github.com/thegeneralist01/social-media-video-downloader-bot
synced 2026-03-07 12:29:55 +01:00
use all cores + postprocessor args
This commit is contained in:
parent
71ad4861bc
commit
b8214e5a12
1 changed files with 5 additions and 3 deletions
|
|
@ -4,17 +4,19 @@ use anyhow::Result;
|
|||
use teloxide::types::UserId;
|
||||
|
||||
pub async fn download(url: &str, user_id: UserId) -> Result<bool> {
|
||||
// The command I use:
|
||||
// yt-dlp "https://www.youtube.com/watch?v=$1" -o "$2" --merge-output-format mp4
|
||||
let cmd = Command::new("yt-dlp")
|
||||
.arg(url)
|
||||
.arg("-o")
|
||||
// .arg("%(title).90s.%(ext)s")
|
||||
.arg(format!("./downloads/{}.%(ext)s", user_id))
|
||||
.arg("--merge-output-format")
|
||||
.arg("mp4")
|
||||
.arg("--concurrent-fragments")
|
||||
.arg("12")
|
||||
.arg("--postprocessor-args")
|
||||
.arg("ffmpeg:-c:v libx264 -profile:v high -preset veryfast -b:v 4133k -bufsize 8266k -maxrate 4500k -r 60 -c:a aac -b:a 128k -threads 12")
|
||||
.output()
|
||||
.expect("Failed to execute command");
|
||||
|
||||
log::debug!("yt-dlp output: {:?}", cmd);
|
||||
Ok(cmd.status.success())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue