Subscribe to YouTube feeds — without the shorts

Saturday, March 8, 2025

In a bid to be more intentional with my media consumption, I have switched to relying primarily on RSS to subscribe to YouTube channels. I removed the YouTube app from my phone and use a browser plugin (mobile and desktop) to strip the recommendations from all the pages. In other words, I can follow channels I care about and search for specific videos, but I won't see any recommendations. The exception is on the YouTube app on my TV, but that doesn't strike me as too bad as I don't compulsively open that app for mindless distraction.

One issue with switching to RSS is that it includes everything, including lives streams and shorts. Some otherwise good channels (I had Zeteo in mind originally) post many shorts per day, and I'm not interested in any of them. So, how can we subscribe to YouTube channels via RSS without the shorts?

MacKenzie has this helpful post showing that YouTube does indeed provide a hidden RSS feed that excludes shorts.

Here's a little Python script that builds the URL for this feed.

#!/usr/bin/python3
import urllib.request
from sys import argv

youtube_url = argv[1]
if youtube_url[0] == "@":
    youtube_url = f"https://www.youtube.com/{youtube_url}"

request = urllib.request.Request(youtube_url)
page = urllib.request.urlopen(request).read().decode()
id_start = page.find('externalId') + 13  # the id starts 13 chars later
id_end = page.find('",', id_start)
channel_id = page[id_start:id_end]
no_shorts_id = "UULF" + channel_id[2:] # replace UC with UULF
feed_url = f"https://www.youtube.com/feeds/videos.xml?playlist_id={no_shorts_id}"
print(feed_url)

To use it, save it as noshorts somewhere in your $PATH, give it the old chmod +x noshorts, and then use as follows

$ noshorts https://www.youtube.com/@zeteo

or you can use noshorts @zeteo. One limitation is the name of the feed is just "Videos"; it doesn't include the channel name, so you will have to manually rename the feed in your reader.


Respond via email