Fetching RSS feeds from YouTube
Posted: | Tags: project rssIt’s an open secret that you can follow YouTube channels through RSS, it’s also something I’ve covered on this blog before. What I wasn’t aware of until recently was how difficult it could be to find the RSS feed for a YouTube channel. I mistakenly thought any RSS service could discover the feed URL from a YouTube channel, but after chatting with Andreas (82Mhz) on Mastodon we discovered this wasn’t the case. It was just a feature of Miniflux which is the RSS service and client that I used.
Annoyed, I looked for a simpler solution to generate an RSS feed URL from YouTube, in essence, all you need is the channel ID to be inserted into this URL https://www.youtube.com/feeds/videos.xml?channel_id={channel_id}
. I found yt-dlp
was able to return the channel ID, so if you prefer a CLI tool this would be the way to go, replace {channel_url}
with the channel URL:
yt-dlp --playlist-items 0 -O playlist:channel_url --print channel_url {channel_url}
I’ve also wrapped this up as a web service where you can paste the channel URL and receive the channel ID along with the feed URL. Andreas (82Mhz) was kind enough to share the service in a blog post and in their weekly link dump. This weekend, I cleaned the code up a bit, fixed some typos and set up automated alerts in case it goes offline, you can find the source code on GitHub.