summaryrefslogtreecommitdiffhomepage
path: root/lib/net
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net')
-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)))