aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-07-16 10:13:36 +0300
committerThanos Apollo <[email protected]>2023-07-16 10:13:36 +0300
commit9d58015618d342382bdbf0250276cb4e82cfe274 (patch)
treed864b5f9fdb5d530bf0f7959affc0a52a9ccdf31
parent24050ae42b376ca1f5f5bb098f73c3a82589a2a9 (diff)
Add yeetube--yt-dlp
Use yt-dlp as (executable-find "yt-dlp")
-rw-r--r--yeetube.el15
1 files changed, 11 insertions, 4 deletions
diff --git a/yeetube.el b/yeetube.el
index c1dd3e3..bdf814e 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -110,6 +110,8 @@ It's recommended you keep it as the default value."
(defvar yeetube--currently-playing nil)
+(defvar yeetube--yt-dlp (executable-find "yt-dlp"))
+
(defun yeetube-check-if-youtube (url)
"Check if it's a youtube URL."
(if (string-match-p "youtube" url)
@@ -262,10 +264,13 @@ PREFIX [[URL/watch?v=VIDEOID][VIDEOTITLE ]]"
(let ((default-directory yeetube-download-directory))
(async-shell-command
(if yeetube-download-audio-format
- (format "yt-dlp %s --extract-audio --audio-format %s"
+ (format "%s %s --extract-audio --audio-format %s"
+ (shell-quote-argument yeetube--yt-dlp)
(shell-quote-argument url)
(shell-quote-argument yeetube-download-audio-format))
- (format "yt-dlp %s" (shell-quote-argument url)))
+ (format "%s %s"
+ (shell-quote-argument yeetube--yt-dlp)
+ (shell-quote-argument url)))
(message "Downloading %s " url))))))
(defun yeetube-download-videos ()
@@ -303,11 +308,13 @@ then run this command interactively."
(buffer-name (format "download-video-%d" buffer-counter)))
(async-shell-command
(if yeetube-download-audio-format
- (format "yt-dlp %s --extract-audio --audio-format %s -o %s"
+ (format "%s %s --extract-audio --audio-format %s -o %s"
+ (shell-quote-argument yeetube--yt-dlp)
(shell-quote-argument url)
(shell-quote-argument yeetube-download-audio-format)
(shell-quote-argument name))
- (format "yt-dlp %s -o %s"
+ (format "%s %s -o %s"
+ (shell-quote-argument yeetube--yt-dlp)
(shell-quote-argument url)
(shell-quote-argument name)))
buffer-name)