From 3760bb37ee29784814ab314901b5d293cad53a14 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 30 Jun 2023 04:21:49 +0300 Subject: Add func to download single video from org buffer Identical to playing video but with yt-dlp instead of mpv. --- org-yt.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'org-yt.el') diff --git a/org-yt.el b/org-yt.el index b5b5d9c..f6f5488 100644 --- a/org-yt.el +++ b/org-yt.el @@ -34,6 +34,15 @@ ;; TODO: Download videos using yt-dlp +;; TODO: let user decide custom name and path +(defun yt-download-video () + "Download using link at point in an `'org-mode buffer with yt-dlp." + (interactive) + (let ((url (org-element-property + :raw-link (org-element-context)))) + (when (string-prefix-p "http" url) + (async-shell-command (format "yt-dlp %s" url)) + (message "Downloading %s " url)))) (provide 'org-yt) -- cgit v1.2.3