28

YouTube officially supports channel RSS feeds, but I'm facing severe difficulties finding the feed. Using the channel URL isn't possible, at least in Thunderbird. Currently, Firefox appears unable to detect the feed (worked in the past unreliably, requiring occasional page refreshes) and Google Chrome has no native RSS support, to my knowledge.

There's a method to manually create a feed, but it may no longer work (channel-external-id doesn't appear in the source of all channels, channel_id in its stead):

  1. View the page’s source code
  2. Look for the following text: channel-external-id
  3. Get the value for that element
  4. Replace that value into this URL:

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

example channel: https://www.youtube.com/user/SesameStreet/videos

1

4 Answers 4

26

Actually what you suggested, is exactly the RSS feed address, although it was changed a bit from the procedure described in your question, there correct string to search is externalId.

With script

The following script will extract the feed URL and will output it to the console:

for (var arrScripts = document.getElementsByTagName('script'), i = 0; i < arrScripts.length; i++) {
    if (arrScripts[i].textContent.indexOf('externalId') != -1) {
        var channelId = arrScripts[i].textContent.match(/\"externalId\"\s*\:\s*\"(.*?)\"/)[1];
        var channelRss = 'https://www.youtube.com/feeds/videos.xml?channel_id=' + channelId;
        var channelTitle = document.title.match(/\(?\d*\)?\s?(.*?)\s\-\sYouTube/)[1];
        console.log('The rss feed of the channel \'' + channelTitle + '\' is:\n' + channelRss);
        break;
    }
}

Result:

The rss feed of the channel 'Sesame Street' is:
https://www.youtube.com/feeds/videos.xml?channel_id=UCoookXUzPciGrEZEXmh4Jjg

Where to save it

  1. You can use it as a user-script (with Greasemonkey or Tampermonkey for example).
  2. You can use it as a Bookmarklet.
  3. Copy the code and paste it into the developer console.

Note: If you choose options 1 or 2 - it would be more convenient to replace the console.log command with alert to get a popup instead of a message to the console.


Manually

  1. Open the desired YouTube channel page.
  2. Open the view-source of that page (one of the following):
    • Ctrl+U.
    • Right click --> View page source.
    • Add view-source: to the beginning of the url in the address bar.
  3. Search for the term externalId
  4. Right after it, there will be a random code (the channel id) in the form of: UCoookXUzPciGrEZEXmh4Jjg
  5. Add the code you found as a suffix to https://www.youtube.com/feeds/videos.xml?channel_id= and now that's your RSS feed for that channel.
5
  • rssUrl unfortunately doesn't exist in the source of every channel, for instance view-source:https://www.youtube.com/channel/UC0YagOInbZxj10gaWwb1Nag/ and view-source:https://www.youtube.com/channel/UCEBTfxJ13zkpZVbZTF3aukg.
    – user598527
    Aug 25, 2018 at 6:50
  • 1
    I'll check it out, and improve my answer, thanks Aug 25, 2018 at 7:56
  • I found the thing, I'll update my answer later today! Aug 25, 2018 at 8:23
  • @user598527 Updated :) Aug 25, 2018 at 8:51
  • Thank you for updating. I haven't been able to install the bookmarklet by using the standard method (dragging code to the bookmarks toolbar). Based on my experience bookmarklets start with javascript:, at least that will help with the browser installation procedure.
    – user598527
    Aug 25, 2018 at 12:59
2

Open the console with F12 and execute

window["ytInitialData"].metadata.channelMetadataRenderer.rssUrl
2
  • I get the TypeError: window.ytInitialData.metadata is undefined error when running in Firefox. Should this command work on all pages of a channel?
    – user598527
    Sep 18, 2019 at 8:46
  • 1
    Hmm, seems like it doesn't work on all pages
    – goweon
    Sep 19, 2019 at 14:13
1

The method you mention currently works, but only in some circumstances, the exact text to look for is data-channel-external-id and it works in IE11, for example. Far easier is getting the <channel-id> in the channel URL, that is composed like this

https://www.youtube.com/channel/<channel-id>

Anyway there is a long more supported way to do this, and it reflect the fact that YouTube likes you to subscribe the channels you want to link through RSS feed.

If you subscribed the channel you are looking the RSS feed for, you can find it listed in your Manage Subscription page, there you can scroll down all the way until you find the "Export in RSS readers" button: clicking on on that button will allow you to download an XML file that has the channel names and RSS feeds for all subscribed channels.

Those RSS feeds will always be updated if something changes in how YouTube expose them.

1

You can use this one-click bookmarklet:

javascript:(function() {
  var url = (document.querySelector('link[type="application/rss+xml"]') || '').href;
  if (url !== undefined) {
    return location.href = url;
  }
  try {
    var channelId = ytplayer.config.args.ucid;
    location.href = 'https://www.youtube.com/feeds/videos.xml?channel_id=' + channelId;
  }
  catch (TypeError) {
    console.error('YouTube RSS feed bookmarklet: Could not find a channel RSS feed');
  }
})();

Output example

Tested with Firefox ESR (v78)

Source: https://codereview.stackexchange.com/questions/160594/bookmarklet-to-go-to-youtube-channel-rss-feed#answer-160650

1
  • 1
    You're amazing! I went through like 5 different answers from different places that didn't work! This one does currently!
    – neminem
    Oct 11, 2021 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.