From 01e77e135096197893522c205b30e6a6d07654c0 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 11 Oct 2026 12:14:26 +0100 Subject: r2e: removing shorts from yt feeds --- lib/net/jao-r2e.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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))) -- cgit v1.2.3