diff options
| author | jao <jao@gnu.org> | 2026-10-11 12:14:26 +0100 |
|---|---|---|
| committer | jao <jao@gnu.org> | 2026-10-11 12:14:26 +0100 |
| commit | 01e77e135096197893522c205b30e6a6d07654c0 (patch) | |
| tree | c9d815526067c0e420e3ba5446a30b28ebfe5d5e | |
| parent | 5ee2ae03e7d835995fa20c12a316bf52795cedf5 (diff) | |
| download | elibs-01e77e135096197893522c205b30e6a6d07654c0.tar.gz elibs-01e77e135096197893522c205b30e6a6d07654c0.tar.bz2 | |
r2e: removing shorts from yt feeds
| -rw-r--r-- | lib/net/jao-r2e.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/net/jao-r2e.el b/lib/net/jao-r2e.el index f28b66b..628e83f 100644 --- a/lib/net/jao-r2e.el +++ b/lib/net/jao-r2e.el @@ -203,6 +203,13 @@ (View-quit)) (when url (cons url (or title ""))))))) +(defun jao-r2e-remove-shorts (url) + (if (and (string-match-p "www\.youtube\.com" url) + (y-or-n-p "Remove shorts? ")) + (string-replace "channel_id=UC" "playlist_id=UULF" url) + url)) + +;;;###autoload (defun jao-r2e-subscribe (url &optional cat relist) "Subscribe to a given RSS URL. If URL not given, look for it." (interactive (list (or (jao-url-around-point) @@ -214,7 +221,8 @@ (unless url (error "No feeds found")) (let ((url (if (string-match "^feed:" url) (substring url 5) url))) (when (y-or-n-p (format "Subscribe to <%s>? " url)) - (let* ((name (read-string "Feed name: " title)) + (let* ((url (jao-r2e-remove-shorts url)) + (name (read-string "Feed name: " title)) (cats (cons "prog" (jao-notmuch-subtags "feeds"))) (cat (completing-read "Category: " cats nil t cat)) (sfmt (format "%%s add %s '%s' mail+feeds_%s@jao.io" name url cat))) |
