summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yeetube.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/yeetube.el b/yeetube.el
index f96a4f3..0fb4f11 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -216,7 +216,7 @@ then for item."
(when (equal yeetube-download-audio-format "no")
(setf yeetube-download-audio-format nil)))
-(defun yeetube-download-ytdlp (url name &optional audio-format)
+(defun yeetube-download-ytdlp (url &optional name audio-format)
"Use yt-dlp with URL as NAME, when AUDIO-FORMAT extract content as audio format.
Name can be left as nil to keep the default name."
@@ -224,9 +224,11 @@ Name can be left as nil to keep the default name."
(unless yeetube-ytdlp
(error "Executable for yt-dlp not found. Please install yt-dlp"))
(call-process-shell-command
- (concat yeetube-ytdlp " '" url "' -o '" name "'"
- (when yeetube-download-audio-format
- " --extract-audio --audio-format '" audio-format "'"))
+ (concat "yt-dlp " (shell-quote-argument url)
+ (when name
+ " -o "(shell-quote-argument name))
+ (when audio-format
+ " --extract-audio --audio-format " (shell-quote-argument audio-format)))
nil 0))
;;;###autoload