no shorts

[img]

previously

Getting rid of shorts from a youtube rss feed.

how to get a channel rss feed

The url of a youtube channel's feed looks like this:

https://www.youtube.com/feeds/videos.xml?channel_id=UC<channel id>

You can find the channel id in various ways, except through the actual youtube website. Invidious instances (that still exist) hand you the channel id through their own rss feed button and are displayed in the actual url.

invidious rss sub

Alternatively you can use something like fuyt or idiotbox, look for a video title of a creator you want to subscribe to and copy the Atom feed.

Finally there is patpatpat's yt2rss, which will return the rss url, if you provide it the channel username. Replace ftp with curl/wget, if applicable.

You should end up with something that looks like this:

https://www.youtube.com/feeds/videos.xml?channel_id=UCdKu1TzBmbUhr9ChRPUB8Lg

Using this url polinates your news reader with everything the channel releases - shorts, longs, lives, paywalls. Some users may not want that.

There is an alternative url that youtube serves, which filters out certain elements from the previous "everything" url. By default (channel feed with everything):

https://www.youtube.com/feeds/videos.xml?playlist_id=UU<channel id>

Notice the UU and look below what you can replace it with.

UU - all public uploads (same as the channel_id= url)
UULF - all public videos
UUMO - all member videos 
UULV - all live streams
UUSH - all shorts
UULP - popular videos
UUPV - popular live streams
UUPS - popular shorts
UUMV - member live streams
UUMS - member shorts

An rss feed for just _major_ uploads would look like this - that is no shorts, no livestreams, no paywalled content:

https://www.youtube.com/feeds/videos.xml?playlist_id=UULFdKu1TzBmbUhr9ChRPUB8Lg

newsboat caveat

Depending on the software you use, this might be enough, but in the case of newsboat, this causes an issue where all the feeds are now titled "Videos". Fortunately, you can label newsboats feeds with whatever you want. Simply add "~title" behind the url. For example.

https://www.youtube.com/feeds/videos.xml?playlist_id=UULFdKu1TzBmbUhr9ChRPUB8Lg "~Myšpule Svět"

You can automatize this with a simple loop, where urls is the file with your playlist feeds. This will curl the individual urls and print back the urls with a newsboat compatible title appended.

#!/bin/ksh
cat urls | while read line; do

echo $line "\"~$(curl -s $line | grep -m1 "<name>" \
| sed -e 's/<[^>]*>//g' -e 's,^ [ \t]*,,g')\""

done