I'm pasting a lot of youtube links in my org-mode files. My procedure is - copy link from youtube and then manually copy the title of the video. I was thinking is this can be automated - just paste link & description will be downloaded.

1 Answer 1


You can use youtube-dl for this. For example:

(defun insert-youtube-link ()
  (let* ((link (read-from-minibuffer "Youtube-Link:"))
         (title (shell-command-to-string (format "youtube-dl --get-title '%s' 2>/dev/null" link)))
         (description (shell-command-to-string (format "youtube-dl --get-description '%s' 2>/dev/null" link))))
      (insert (format "[[%s][%s]]" link title))
      (forward-line 1)
      (insert (format "Description: %s" description)))))))    

You may add some error handling and maybe make the code clearer, but this should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.