Create podcast feeds from YouTube channels and playlists
- Generate RSS feeds that can be added to podcast apps with support for video podcasts (e.g. Pocket Casts)
- Simple web server for serving RSS feed data, video links, and UI
As of December 2024, YouTubeCast is no longer publicly hosted. YouTube has made changes to combat bot traffic that make it impractical to host a publicly available version of YouTubeCast. Self-hosting should be used instead moving forward.
Additional Changes:
- YouTubeCast Video Server is being deprecated in favor of unifying all of YouTubeCast's functionality in a single project. For now, support for videos in higher quality (above 720p) has been removed. This functionality may become available directly within YouTubeCast at a later date. If you want to keep this functionality in the interim, you can continue to use the Docker images for both YouTubeCast and YouTubeCast Video Server with the tag
legacy
. - YouTube Shorts are now always exlcuded and the
excludeShorts
query parameter has been deprecated. - Support for Redis cache has been removed as distributed hosting is no longer practical (in-memory cache will be used instead).
Prerequisites:
- Ensure Docker is set up and running on your machine (https://docs.docker.com/get-docker)
- Set up a hostname that can be used to access your machine from the internet (can use a static IP address as well)
- Get a YouTube API v3 key set up (https://developers.google.com/youtube/v3/getting-started)
To run this application using Docker:
- Create the
docker-compose.yml
file as described below - Run
docker-compose up -d
in the folder where yourdocker-compose.yml
lives - Check the logs using
docker-compose logs -f
to see if there are any errors in your configuration - Access the UI on port 80, input a channel's name, and add the podcast feed to your podcast app of choice
services:
youtubecast:
image: trevorsharp/youtubecast:latest
container_name: youtubecast
restart: unless-stopped
ports:
- 80:3000
environment:
- "YOUTUBE_API_KEY=XXXXX"
- "COOKIES=XXXXX"
- ENABLE_PLAYLIST_SORTING=false
Create a file named docker-compose.yml
with the contents above. Add in your YouTube API key.
If you want to download YouTube content that requires user authentication to download, you will need to add cookies to your configuration. One reason for needing this is to download members-only videos. Note that the source of these videos (channel, user, or playlist) still must be either public or unlisted. For members-only videos, go to the channel's home page and scroll down to find an auto-generated playlist titled "Members-only videos" which will contain all the videos posted for members of the channel.
To generate this environment variable:
- Download a browser extension (such as this one for Chrome)
- Log in to YouTube
- With a YouTube tab open, open the cookies.txt extension and view the cookies as an HTTP header string
- Copy the HTTP header string and use that value to set the environment variable COOKIES
Note that for playlists, the podcast feed will return with the first 50 videos in the playlist (from the top). If the playlist has more than 50 videos and new videos are added to the end of the playlist, then the podcast feed may not include the newest videos. Unfortunately, YouTube's APIs make it cost-prohibitive to get the items at the end of long playlists. If you want to have these type of playlists in your podcast player, you can set the environment variable ENABLE_PLAYLIST_SORTING=true
. Alternatively, if you are the creator of the playlist, you can set the playlist's sort order to newest on top.