CAUTION: This package is still under development, breaking changes are very possible.
– Daft Punk, on podcast lengths
elfeed-time displays the approximate time it will take to read, watch, or listen to an elfeed entry. It can display this information in both elfeed-search-mode
, and elfeed-show-mode
.
elfeed-time can measure the length of:
- Youtube videos
- Youtube premieres
- podcasts
- and of course text (including feeds that only give a preview)
(straight-use-package '(elfeed-time :type git :host github :repo "zabe40/elfeed-time"))
- curl
- One of: yt-dlp, youtube-dl, or yt-dlc
- ffprobe
This advice is needed because elfeed doesn’t currently have a way to tell it’s garbage collector about the elfeed-refs we create with elfeed-time-maybe-get-video-info
and elfeed-time-maybe-get-full-content
. Without the advice, the refs in the :et-content
meta slot would be deleted by elfeed-db-gc
. For more information see this issue, and this pull request.
(advice-add 'elfeed-db-gc :override #'elfeed-time-db-gc-trace-meta)
(setf elfeed-show-refresh-function elfeed-time-refresh-mail-style-function)
(setf elfeed-search-print-entry-function #'elfeed-time-search-print-entry)
(add-hook 'elfeed-new-entry-hook #'elfeed-time-new-entry 80)
For example, if you don’t subscribe to any podcasts with elfeed, you won’t need to add elfeed-time-maybe-get-podcast-info
to elfeed-time-new-entry-functions
.
(add-hook 'elfeed-new-entry-hook
(elfeed-make-tagger :feed-url (rx "youtube.com")
:add '(video)))
(add-hook 'elfeed-new-entry-parse-hook #'elfeed-time-parse-youtube-description)
(add-hook 'elfeed-time-new-entry-functions #'elfeed-time-maybe-get-video-info 10)
(add-hook 'elfeed-time-new-entry-functions #'elfeed-time-maybe-get-premiere-info 20)
(add-hook 'elfeed-time-new-entry-functions #'elfeed-time-maybe-get-podcast-info 30)
(add-hook 'elfeed-time-new-entry-functions #'elfeed-time-maybe-get-full-content 40)
(add-hook 'elfeed-time-new-entry-functions #'elfeed-time-maybe-make-entry-readable 50)
(add-hook 'elfeed-time-new-entry-functions #'elfeed-time-count-entry-words 60)
(add-hook 'elfeed-time-entry-time-functions #'elfeed-time-video-time 10)
(add-hook 'elfeed-time-entry-time-functions #'elfeed-time-premiere-time 20)
(add-hook 'elfeed-time-entry-time-functions #'elfeed-time-podcast-time 30)
(add-hook 'elfeed-time-entry-time-functions #'elfeed-time-text-time 40)
(add-hook 'elfeed-time-preprocess-functions #'elfeed-time-preprocess-youtube-description -10)
(setf elfeed-time-reading-speed 250)
(setf elfeed-time-ignore-private-videos t)
(setf elfeed-time-update-entries-after-hook-p t)
(define-key elfeed-show-mode-map (kbd "R") #'elfeed-time-show-toggle-readable)
(setf elfeed-search-header-function #'elfeed-time-header)
(setf elfeed-search-sort-function #'elfeed-time-compare-entries)
(setf elfeed-sort-order 'ascending)
elfeed-time can also account for the fact that you might play some of your videos and podcasts at 2x speed. Just set that feed’s speed by calling the function elfeed-time-set-feed-speed
, or set a default speed multiplier for all videos and podcasts by setting the variable elfeed-time-speed-multiplier
.
- I haven’t figured out a good way to determine how long it takes to read webcomics. Perhaps sort them into webcomics that publish chapters VS pages at a time? Or maybe try to measure it’s length in inches and have a variable for inches per second?
- Newsletters pose a similar problem, since they can have many links, and it’s impossible to know which set of links you’ll follow.
- yt-dlp currently doesn’t have a way to access the localized title of a video, see this issue.
elfeed-time cannot account for time spent pondering, note-taking, cross-referencing, rereading, grappling with, examining, or otherwise thinking about entries.
Feel free to open an issue or pull request for any type of entry that isn’t yet supported by elfeed-time!