diff options
author | JSDurand <mmemmew@gmail.com> | 2021-03-03 11:08:34 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2021-03-03 11:08:34 +0800 |
commit | 82ee45737d2af92ac583d6319d5589d3f0b61c9e (patch) | |
tree | c703c79e0187e598291ccfb4b586ab3e3d9ccbaa /elfeed-conf.el | |
parent | a8e1ec1aa5271c54fbcdd8d52ca5a8d373da1f9c (diff) |
Add some feeds and a filter for downloading.
* elfeed-conf.el (elfeed-feeds): More feeds.
(durand-eshell-download-filter): Replace the previous string before
inserting new strings.
(durand-elfeed-download-video): Reminds of the start of the download,
and uses the filter.
Diffstat (limited to 'elfeed-conf.el')
-rw-r--r-- | elfeed-conf.el | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/elfeed-conf.el b/elfeed-conf.el index 378ac9f..00893a2 100644 --- a/elfeed-conf.el +++ b/elfeed-conf.el @@ -30,6 +30,8 @@ (setq elfeed-feeds (list (list "https://wiwi.video/feeds/videos.atom?sort=-publishedAt" 'wiwi) + (list "https://wiwikuan.com/index.xml" + 'wiwi 'blog) (list "https://protesilaos.com/codelog.xml" 'prot 'code) (list "https://protesilaos.com/news.xml" @@ -41,7 +43,9 @@ (list "https://notrelated.xyz/rss" 'lukesmith 'notrelated) (list "https://lukesmith.xyz/peertube" - 'lukesmith 'youtube))) + 'lukesmith 'youtube) + (list "https://www.youtube.com/feeds/videos.xml?channel_id=UCiWXd0nmBjlKROwzMyPV-Nw" + 'zhichi 'youtube))) (define-key elfeed-search-mode-map (vector #x78) 'elfeed-search-exit) @@ -89,6 +93,19 @@ This informs the user when STATUS is the string \"finished\\n\"." (message "Downloading videos has finished.")))) ;;;###autoload +(defun durand-eshell-download-filter (process output) + "Display OUTPUT in the buffer associated with PROCESS. +By display it is meant that before inserting the ouput the buffer +will first be erased." + (let ((buffer (process-buffer process))) + (cond + (buffer + (with-current-buffer buffer + (erase-buffer) + (insert + (replace-regexp-in-string "
\\|" "" output))))))) + +;;;###autoload (defun durand-elfeed-download-video () "Download the video in the feed." (interactive) @@ -99,10 +116,12 @@ This informs the user when STATUS is the string \"finished\\n\"." ((derived-mode-p 'elfeed-show-mode) (setq link (elfeed-entry-link elfeed-show-entry))) ((user-error "Not in an elfeed buffer"))) + (message "Downloading starts.") (make-process :name "elfeed download video" :buffer "*elfeed download*" :sentinel #'durand-eshell-download-sentinel + :filter #'durand-eshell-download-filter :command (list "youtube-dl" "-f" "bestvideo[height<=720]+bestaudio/best[height<=720]/best" link)))) |