Elfeed: Add elfeed-download-with-youtube-dl.
parent
0588198194
commit
49334c5c87
|
@ -30,6 +30,15 @@
|
|||
(setq quality-arg (format "--ytdl-format=[height<=?%s]" quality-val)))
|
||||
(start-process "elfeed-mpv" nil "mpv" quality-arg (elfeed-entry-link entry))))
|
||||
|
||||
(defun ambrevar/elfeed-download-with-youtube-dl ()
|
||||
"Download entry with youtube-dl."
|
||||
(interactive)
|
||||
(let ((entry (if (eq major-mode 'elfeed-show-mode) elfeed-show-entry (elfeed-search-selected :single)))
|
||||
(default-directory (expand-file-name "~/Downloads")))
|
||||
;; TODO: Use ytdl.
|
||||
(message "Downloading %s with youtube-dl..." (elfeed-entry-link entry))
|
||||
(start-process "elfeed-youtube-dl" nil "youtube-dl" "-f" "best" (elfeed-entry-link entry))))
|
||||
|
||||
(defun ambrevar/elfeed-open-with-eww ()
|
||||
"Open in eww with `eww-readable'."
|
||||
(interactive)
|
||||
|
@ -38,7 +47,7 @@
|
|||
(add-hook 'eww-after-render-hook 'eww-readable nil t)))
|
||||
|
||||
(defvar ambrevar/elfeed-visit-patterns
|
||||
'(("//[^/]*youtu\\.?be" . ambrevar/elfeed-play-with-mpv)
|
||||
'(("//[^/]*youtu\\.?be" . ambrevar/elfeed-download-with-youtube-dl)
|
||||
("phoronix" . ambrevar/elfeed-open-with-eww))
|
||||
"List of (regexps . function) to match against elfeed entry link to know
|
||||
whether how to visit the link.")
|
||||
|
|
Loading…
Reference in New Issue