diff options
author | Thanos Apollo <[email protected]> | 2023-06-30 04:21:49 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-06-30 04:21:49 +0300 |
commit | 3760bb37ee29784814ab314901b5d293cad53a14 (patch) | |
tree | c15fd7965c067573b32d1d9acfd293776f7204c1 | |
parent | 9a7f9b280a5c60dfd7b598f2908f3717aa756004 (diff) |
Add func to download single video from org buffer
Identical to playing video but with yt-dlp instead of mpv.
-rw-r--r-- | org-yt.el | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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) |