summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-10-03 07:44:39 +0300
committerThanos Apollo <[email protected]>2023-10-03 07:50:43 +0300
commit2d82228ec38b8e7286ebf8da0fa223be10f5a5d3 (patch)
treea8db79254ea01107bb08b683cd0595c3fbe57df6
parente4ab8b311402ad9c64a56ef134575d8dce564316 (diff)
[fix] yeetube-download-ytdlp: Use shell-quote-argument
Rewrite yeetube-download-ytdlp to use shell-quote-argument. Avoiding bugs from obscure shells. Pointed out by progofolio https://github.com/melpa/melpa/pull/8625
-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