summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2026-10-11 12:14:26 +0100
committerjao <jao@gnu.org>2026-10-11 12:14:26 +0100
commit01e77e135096197893522c205b30e6a6d07654c0 (patch)
treec9d815526067c0e420e3ba5446a30b28ebfe5d5e /lib
parent5ee2ae03e7d835995fa20c12a316bf52795cedf5 (diff)
downloadelibs-01e77e135096197893522c205b30e6a6d07654c0.tar.gz
elibs-01e77e135096197893522c205b30e6a6d07654c0.tar.bz2
r2e: removing shorts from yt feeds
Diffstat (limited to 'lib')
-rw-r--r--lib/net/jao-r2e.el10
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)))