diff options
author | Thanos Apollo <[email protected]> | 2023-07-03 11:19:57 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-07-03 11:19:57 +0300 |
commit | d424240f179db72d16933546708fbeebaf00180d (patch) | |
tree | f4a24b07fff4809fcf5d2fa53ebd0559c53f5524 | |
parent | 80a7e7a8fbb19621aa56d4c8ad1607a7473703fb (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.el | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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)))))) |