- Python 97%
- Shell 3%
YouTube Playlist Podcast Mirror #
yt-playlist-podcast polls a YouTube playlist Atom feed, downloads media for any new feed entries with yt-dlp, and writes two podcast-style RSS feeds:
public/video.xmlpublic/audio.xml
Old entries are kept in public/state.json, so they stay in the generated RSS feeds even after YouTube stops returning them in the Atom feed.
If your output directory is publicly served and you do not want the state file exposed, pass --state-file /some/private/path/state.json.
Requirements #
- Python 3.9+
ffmpeg, for audio extraction and MP4 remuxing
Install the project and its Python dependencies into a virtual environment:
python3 -m venv .venv
.venv/bin/python -m pip install .
With uv, target the project virtual environment explicitly:
uv venv
uv pip install --python .venv/bin/python .
Use a regular install rather than -e: on macOS with Python 3.14, uv's editable
install helper can be marked hidden and Python skips it during startup.
First Run #
.venv/bin/yt-playlist-podcast \
--base-url https://example.com/podcast \
--output-dir /var/www/html/podcast
The default source feed is:
https://www.youtube.com/feeds/videos.xml?playlist_id=PLfDZlLbHrK7jL9xYzfcPVQBa0F3zJgHxA
If a YouTube playlist Atom feed returns 404/500, the command falls back to
yt-dlp --flat-playlist for that playlist and continues with the latest visible
playlist entries. This avoids the intermittent YouTube RSS endpoint failures,
but it is still limited by what yt-dlp can read from the public playlist page.
Use --max-new 1 on the first run if you want to avoid downloading everything visible in the Atom feed at once.
Cron #
*/30 * * * * cd /path/to/yt-pod && /path/to/yt-pod/.venv/bin/yt-playlist-podcast --base-url https://example.com/podcast --output-dir /var/www/html/podcast >> /var/log/yt-podcast.log 2>&1
The generated subscription URLs will be:
https://example.com/podcast/video.xmlhttps://example.com/podcast/audio.xml
You can also set PODCAST_BASE_URL in the environment instead of passing --base-url.