This site is being remade and I won't be updating this for a while. Expect a lot of broken links, design and functionality. If all goes well, things should be stable by the end of 2022. Thank you for understanding.


Using iOS Shortcuts and JavaScript To Extract RSS Feed URLs From YouTube

Published Updated

A few months ago, I got into RSS readers. Given how much YouTube I watch along with YouTube’s broken subscription tab, I wondered if YouTube had RSS feeds.

Turns out it does, but they aren’t advertised. Even with an RSS reader that discovers feeds, it only works for certain pages. So I decided to use iOS Shortcuts to do it for me.


The shortcut will works like this:

  1. Parse the URL for the Channel or Playlist ID and return the feed URL
  2. If step 1 works, ask the user if they want to copy the URL. If so, copy it.
  3. If step 2 doesn’t work, notify the user.

In this post, I’ll focus on 1.

The JavaScript

I expected to do a lot of DOM manipulation and web scraping, but the URL has everything I need. All the feed URLs build on the URL

TypeURL PatternFeed URLid
User (user)
Playlist (playlist_id or
Channel (channel_id)

Youtube has another URL scheme like but the only way to get the RSS feed for it is to use YouTube’s API on the username. This is not the same as the user_id.

The Code

Nothing too exciting although I did learn about URL parsing using window.location and URLSearchParams.

const YOUTUBE_DOMAINS = ["","", ""];
const BASE_FEED_URL = "";
const pathArr = window.location.pathname.split("/");
const searchParams = new URLSearchParams(;
const playlistID = searchParams.get("list");

if (YOUTUBE_DOMAINS.indexOf(window.location.hostname) === -1) {
    completion("Non Playlist/Channel");
if (playlistID){
    let playlistFeedURL = `${BASE_FEED_URL}playlist_id=${playlistID}`;
} else {
    let basePath = pathArr[1];
    if(basePath === "channel") {
       let channelID = pathArr[2];
       let channelFeedURL = `${BASE_FEED_URL}channel_id=${channelID}`;
    } else if ("user" === basePath){
        let user = pathArr[2];
        let userFeedURL = `${BASE_FEED_URL}user=${user}`;
    } else {
      completion("Non Playlist/Channel");

Also note the completion function. This is needed to pass arguments along the shortcut.


You can discover the full shortcut here. **Note 10 October 2022: **The shortcut doesn’t exist anymore and it’ll be part of my project YouTube x RSS once I get around to making it again.