From 2d82228ec38b8e7286ebf8da0fa223be10f5a5d3 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 3 Oct 2023 07:44:39 +0300 Subject: [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 --- yeetube.el | 10 ++++++---- 1 file 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 -- cgit v1.2.3