summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--org-yt.el9
1 files changed, 9 insertions, 0 deletions
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)