karthink / elfeed-tube

Youtube integration for Elfeed, the feed reader for Emacs
The Unlicense
241 stars 11 forks source link

Support for Channels #4

Closed johnhamelink closed 2 years ago

johnhamelink commented 2 years ago

Hey there!

I've been using Elfeed with YouTube for some time now, taking advantage of YouTube's channel RSS Feeds - here are some examples:

https://www.youtube.com/feeds/videos.xml?channel_id=UCDpL0v-Ifie7u05lbfO3zJQ
https://www.youtube.com/feeds/videos.xml?channel_id=UCckETVOT59aYw80B36aP9vw
https://www.youtube.com/feeds/videos.xml?channel_id=UC3_AWXcf2K3l9ILVuQe-XwQ
https://www.youtube.com/feeds/videos.xml?channel_id=UC7FkqjV8SU5I8FCHXQSQe9Q
https://www.youtube.com/feeds/videos.xml?channel_id=UCHsqqRjziUaMwZgQZHw-n1w

The equivilent invidious URL is simply:

https://youtube.076.ne.jp/api/v1/channels/UCDpL0v-Ifie7u05lbfO3zJQ
https://youtube.076.ne.jp/api/v1/channels/UCckETVOT59aYw80B36aP9vw
https://youtube.076.ne.jp/api/v1/channels/UC3_AWXcf2K3l9ILVuQe-XwQ
https://youtube.076.ne.jp/api/v1/channels/UC7FkqjV8SU5I8FCHXQSQe9Q
https://youtube.076.ne.jp/api/v1/channels/UCHsqqRjziUaMwZgQZHw-n1w

I've been using elfeed-org up until now, but I've been able to try things out with the following snippet:

(defun jjh/org-link-info (link)
  "Extract the URL from an org LINK."
  (let ((path (org-element-property :path link))
        (type (org-element-property :type link)))
    (format "%s:%s" type path)))

(defun jjh/get-links-from-org-file (file)
  "Extract the URLs of all LINKs in the org FILE."
  (with-temp-buffer
    (insert-file-contents file)
    (org-mode)
    (org-element-map (org-element-parse-buffer) 'link 'jjh/org-link-info)))

(elfeed-tube-add-feeds (jjh/get-links-from-org-file "~/org/feeds/youtube.org"))

Unfortunately elfeed-tube doesn't support the RSS feed style of URL. I will take a look and see if I can submit a PR.

Edit: I see now that elfeed-tube is designed for RSS feeds.

karthink commented 2 years ago

I didn't understand your question. A couple of comments though:

  1. If you already have Youtube feeds in your elfeed-feeds, elfeed-tube should just work out of the box. No glue code should be necessary. Let me know if it doesn't work for you?

  2. If you're subscribed to the RSS feeds provided by Invidious instead of Youtube, elfeed-tube may not recognize entries from this feed as Youtube videos. If this is the issue I can add a user option where you can specify Invidious URLs (youtube.076.ne.jp in your case) that you want elfeed-tube to recognize as Youtube videos.

johnhamelink commented 2 years ago

Hey @karthink, thanks for this package!

Please just diregard this issue, it's based on a total misunderstanding - I simply hadn't read the first paragraph in the Usage section:

Elfeed Tube tries its best to work out of the box with no set up, but Step I below is unavoidable if you’re starting fresh. If you already have Youtube feeds in your Elfeed feed list, you can go to Step II.

I was trying to add my RSS feeds to elfeed-tube directly via elfeed-tube-add-feeds, but my elfeed setup was ready to work out of the box!

Thanks JH

karthink commented 1 year ago

Please just diregard this issue, it's based a total misunderstanding: I simply hadn't read the first paragraph in the Usage section:

No worries, I should rewrite that section to be clearer!