diff options
-rw-r--r-- | yeetube-mpv.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/yeetube-mpv.el b/yeetube-mpv.el index 45cd6f8..24a10a1 100644 --- a/yeetube-mpv.el +++ b/yeetube-mpv.el @@ -34,10 +34,15 @@ (defvar yeetube-mpv-path (executable-find "mpv") "Path for mpv executable.") +(defun yeetube-mpv-check () + "Check if mpv and yt-dlp is installed." + (pcase (and (executable-find "mpv") + (executable-find "yt-dlp")) + (`nil (error "Unable to play video. Please install `yt-dlp' and `mpv'")))) + (defun yeetube-mpv-process (command) "Start yeetube process for shell COMMAND." - (unless yeetube-mpv-path - (error "Mpv not found. Install mpv or change the value of yeetube-player")) + (yeetube-mpv-check) (let ((yeetube-mpv-process "yeetube")) (dolist (process (process-list)) (when (string-match yeetube-mpv-process (process-name process)) |