Updates to YouTube-Podcaster-Feed-Creator

This weekend I rolled out some updates to the YouTube-Podcaster-Feed-Creator.

This script, which I use to get a true RSS feed with enclosures for video versions of podcasts who use Google Hangouts or otherwise post their videos to youtube, had been broken by Google’s deprecation of their old API as they rolled out v3.

In the old (v2) API, you could just make calls out to an http endpoint like this:

http://gdata.youtube.com/feeds/api/users/username/uploads

And you’d get back a response you could parse to see all the uploads under that username, out of which you could construct an RSS feed.

For the new API, you need to first generate a server key. Create a project in the Google Developers Console, enable the YouTube Data API v3, and then generate a server key.

For any given podcast, you need to find the relevant Playlist ID. In general, the easiest way is to use the Google API explorer youtube.channels.list, put in contentDetails for “part” and username under “for Username.”

In the results, you’ll see a JSON structure – you’re looking for “uploads” under “Related Playlists” – that playlistId will work with the script to find all videos uploaded by this user.

Configure the script with your API key and the playlist ID, and you get a valid RSS feed with enclosures.

Note: I’ve discovered the feeds produced don’t work with PocketCasts on my iPad – you just get the YouTube Device Support video – but they do work with Downcast.  My guess is they are doing some caching or other server-side stuff that interferes.