Scripts to help add a youtube subscription feed to an RSS reader.
git clone https://github.com/Kostas-F/youtube-to-rss
cd ./youtube-to-rss
- If creating a channel list csv:
pip install -r requirements.txt
andpython3 channelsToCSV.py
- If creating a channel list csv:
python3 youtubeToRSS.py
- add the opml file to the reader you want to use
- Download the script to a directory you have permissions to write to. (eg Desktop or Downloads should work)
- Run the script by running the command
python3 youtubeToRSS.py
in your terminal. You need to have python3 installed. - Point the script to a .csv file with the youtube channels you want to track via RSS by following the instrucitons.
- Import the resulting .opml file to the RSS reader of your choice.
(The gif uses an old scipt name.)
- Download both scripts in a directory you have permissions to write to.
- To run the script you need to have python3 installed. Also you need to run
pip install -r requirements.txt
in the directory you downloaded the scripts to install any missing modules you may not have installed (at this point this installs only urlib3) - Run the script by running the command
python3 channelsToCSV.py
in your terminal. - Point the script to a textfile with links in each line. Links can point to channels or individual videos. You can also add them one by one.
- Use the resulting .csv file with
youtubeToRSS.py
.
To get a channels RSS feed:
- Go to the channel you want to follow
- Find the channel ID
- If the url looks like this:
https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw
then the ID is the random string after channel/ (ieUCYO_jab_esuFRV4b17AJtAw
) - If the url has a username like this
https://www.youtube.com/user/USERNAME
you can find their ID by- Viewing the page source (Ctrl+U)
- Search the page (Ctrl+F) for
external_id
orchannel_id
or simplyyoutube/channel/
and copy the string that follows.
- The channel feed is this url :
https://www.youtube.com/feeds/videos.xml?channel_id=THE_CHANNEL_ID_HERE
The above is a valid RSS feed you can add to the reader of your choice. You can also follow by user via this link
https://www.youtube.com/feeds/videos.xml?user=USERNAME
and by playlist
https://www.youtube.com/feeds/videos.xml?playlist_id=YOUR_YOUTUBE_PLAYLIST_NUMBER
though there may be a querry limit that breaks this, I haven't tested it myself.
There used to be a button to follow channels via RSS as well as to extract your subsciptions to RSS but it is no longer there. The possible ways I found to get a list of your subscribed channels are:
- Crawl your subscription list (which is a pain to find as well) and extract the channel links.
- Do the above by hand
- Request for an API key and use the developer console to possibly get access. Personally I have no experience with this.
- Ask for google for your data here. You only need to check the "Youtube and Youtube Music" box. Check in the zip file after downloading for subscriptions.csv (or similar in case something changes)
- Use the channelsToCSV script in this repo to get channel IDs and names. See this section for more detailed instuctions
To get a file with your already existing subscriptions it will probably be faster to use google takeout at this point. The youtubeToRSS script will (hopefully) work with any csv that contains channel IDs and names.
Plaintext links
subscription list - https://www.youtube.com/feed/channels
google takeout - https://takeout.google.com/
google developer console - https://console.developers.google.com/
python installation guide - https://realpython.com/installing-python/