Host YouTube channel feeds as podcasts, with streaming video-to-audio conversion.
node
,npm
- FFmpeg (development has been done against FFmpeg 2.2)
$ git clone https://github.com/danielpgross/yt-audio-to-podcast
$ cd yt-audio-to-podcast
$ nano config/local.json # See configuration section below
$ node server.js
Once the server is running, you should be able to subscribe to podcasts using any podcast client through feed URLs following the pattern http://[YOUR HOSTNAME]/[YOUTUBE USERNAME]/user.xml
. This feed file is generated on demand using the YouTube username passed in the URL.
For example, to subscribe to an audio-only feed for the White House YouTube channel from a server running on localhost
, use http://localhost/whitehouse/user.xml
To subscribe to a specific channel you can use this URL:
http://[YOUR HOSTNAME]/[YOUTUBE CHANNEL ID]/channel.xml
Since podcasts are streamed directly to the client without saving temporary files on the server (see "How it works" below), the server is uncertain of the filesize when initiating file transfers and does not tell the client how large a file to expect. As a result, the client is unable to estimate download progress and completion time. Practically, this means that most clients will show an "uncertain" progress bar and the download might not appear to be working. This behaviour is normal and the download should eventually complete.
The iOS Podcasts app can subscribe to any podcast URL, it is not limited to podcasts from the iTunes store. See http://www.cnet.com/how-to/add-any-podcast-to-the-ios-podcasts-app/ for instructions on how to do subscribe to a non-iTunes podcast.
The app requires a YouTube API key in order to query channel videos. An API key can be obtained for free using a regular Google account at https://developers.google.com/youtube/registering_an_application.
Edit config/local.json
to enter your API key and to choose a port for the server to run on.
When the feed file is requested, the app queries the YouTube API for the list of videos on the requested channel. This list is used to generate a podcast-format RSS file, with file download URLs linking back to the server.
When the podcast client requests an MP3 file for an episode, the server downloads the video, transcodes it on the fly to audio only, and streams it to the client. Using this approach, no extra storage space is needed on the server for storing episodes.