summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-07-03 11:19:57 +0300
committerThanos Apollo <[email protected]>2023-07-03 11:19:57 +0300
commitd424240f179db72d16933546708fbeebaf00180d (patch)
treef4a24b07fff4809fcf5d2fa53ebd0559c53f5524
parent80a7e7a8fbb19621aa56d4c8ad1607a7473703fb (diff)
yeetube-download-videos: Check for audio-format
If yeetube-download-audio-format, covert to the specified format. If nil use the default.
-rw-r--r--yeetube.el16
1 files changed, 11 insertions, 5 deletions
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))))))