From d424240f179db72d16933546708fbeebaf00180d Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 3 Jul 2023 11:19:57 +0300 Subject: yeetube-download-videos: Check for audio-format If yeetube-download-audio-format, covert to the specified format. If nil use the default. --- yeetube.el | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'yeetube.el') diff --git a/yeetube.el b/yeetube.el index 7c37b53..28dc366 100644 --- a/yeetube.el +++ b/yeetube.el @@ -170,8 +170,7 @@ Example Usage: (defun yeetube-download-videos () "Download one or multiple videos using yt-dlp. -This command is not meant to be used through the -*Yeetube Search* buffer. +This command is not meant to be used in the *Yeetube Search* buffer. Usage Example: Open a Dired buffer and navigate where you want to download your videos, @@ -201,9 +200,16 @@ then run this command interactively." (let ((url (car pair)) (name (cdr pair)) (buffer-name (format "download-video-%d" buffer-counter))) - (async-shell-command (format "yt-dlp %s -o %s" (shell-quote-argument url) - (shell-quote-argument name)) - buffer-name) + (async-shell-command + (if yeetube-download-audio-format + (format "yt-dlp %s --extract-audio --audio-format %s -o %s" + (shell-quote-argument url) + (shell-quote-argument yeetube-download-audio-format) + (shell-quote-argument name)) + (format "yt-dlp %s -o %s" + (shell-quote-argument url) + (shell-quote-argument name))) + buffer-name) (setq buffer-counter (1+ buffer-counter)))))) -- cgit v1.2.3