From 5db25e807fb6fc67d40bdb3126487d442523e989 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 9 Feb 2024 09:10:45 +0200 Subject: Add yeetube-mpv-ytdl-format-video-quality --- yeetube-mpv.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yeetube-mpv.el b/yeetube-mpv.el index cd436e6..5b43ae1 100644 --- a/yeetube-mpv.el +++ b/yeetube-mpv.el @@ -72,6 +72,10 @@ Accepted values include: 1080, 720, 480, 360, 240, 144") (start-process-shell-command "yeetube" nil command)))) +(defun yeetube-mpv-ytdl-format-video-quality (resolution) + "Return shell quoted argument for ytdlp with RESOLUTION." + (shell-quote-argument (format "bestvideo[height<=?%s]+bestaudio/best" resolution))) + (defun yeetube-mpv-play (input) "Start yeetube process to play INPUT using mpv. @@ -80,7 +84,9 @@ to play local files." (yeetube-mpv-process (concat (when yeetube-mpv-enable-torsocks (concat yeetube-mpv-torsocks " ")) - yeetube-mpv-path " " + yeetube-mpv-path " --ytdl-format=" + (yeetube-mpv-ytdl-format-video-quality yeetube-mpv-video-quality) + " " (shell-quote-argument input) (when yeetube-mpv-disable-video " --no-video"))) (message (if yeetube-mpv-enable-torsocks -- cgit v1.2.3