A Python script that creates and maintains a Spotify playlist with the latest episodes from your favorite daily podcasts. Run it each morning and your playlist is ready to go.
Spotify doesn't auto-queue podcast episodes. If you listen to multiple daily shows (news briefings, etc.), you have to manually find and queue each one every morning. This script does it for you.
- Python script (this page) — simplest option: runs on your machine, tokens cached locally, automate with cron or a LaunchAgent.
- Cloudflare Worker (
worker/) — self-hosted and fully automated: updates every morning on Cloudflare's free tier without your computer being on, and includes a web UI for connecting Spotify and managing your podcast list.
- Creates a private "Daily Podcasts" playlist
- Clears old episodes and adds today's latest
- Supports multiple podcasts
- Custom playlist cover image
- Caches auth tokens (only authorize once)
- Go to developer.spotify.com/dashboard
- Click Create App
- Fill in:
- App name: Daily Podcasts
- App description: Daily podcast playlist updater
- Redirect URI:
http://127.0.0.1:8888/callback
- Click Save
- Go to Settings and copy your Client ID and Client Secret
Edit queue_podcasts.py and add your credentials:
SPOTIFY_CLIENT_ID = "your_client_id_here"
SPOTIFY_CLIENT_SECRET = "your_client_secret_here"Add your podcasts to the PODCASTS list:
PODCASTS = [
{
"name": "FT News Briefing",
"show_id": "1410RabA4XOqO6IV8p0gYF"
},
{
"name": "Up First from NPR",
"show_id": "2mTUnDkuKUkhiueKcVWoP0"
}
]pip install requestspython queue_podcasts.pyThe first run opens a browser for Spotify authorization. After that, tokens are cached and it runs without interaction.
- Open the podcast in Spotify
- Click ⋯ → Share → Copy link to show
- The show ID is in the URL between
/show/and?:
https://open.spotify.com/show/2mTUnDkuKUkhiueKcVWoP0?si=...
└─────────────────────┘
show_id
# Default: today's episodes, replaces playlist contents
python queue_podcasts.py
# Include episodes from the last 2 days
python queue_podcasts.py --days 2
# Add new episodes without removing old ones
python queue_podcasts.py --keep-old
# Always keep each show's most recent episode, even if it's older
# than the time window (so shows without a new episode stay queued)
python queue_podcasts.py --keep-latest
# Use a custom playlist name
python queue_podcasts.py --playlist "Morning News"
# Combine options
python queue_podcasts.py --days 2 --keep-old --playlist "Weekly Pods"Set a custom cover image by editing the config:
PLAYLIST_COVER_IMAGE = "/path/to/cover.jpg"Requirements:
- JPEG format
- Square dimensions (300x300 or 640x640 recommended)
- Under 256KB
crontab -eAdd:
0 6 * * * cd /path/to/daily-podcasts && python3 queue_podcasts.py >> ~/podcasts.log 2>&1
Create ~/Library/LaunchAgents/com.dailypodcasts.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.dailypodcasts</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python3</string>
<string>/path/to/queue_podcasts.py</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>6</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</dict>
</plist>Load it:
launchctl load ~/Library/LaunchAgents/com.dailypodcasts.plistMake sure your Spotify app's Redirect URI is exactly:
http://127.0.0.1:8888/callback
Click Add after entering it, then Save.
Clear cached tokens and re-authorize:
rm ~/.spotify_podcast_token.json
python queue_podcasts.pySame fix — clear tokens and re-authorize:
rm ~/.spotify_podcast_token.json
python queue_podcasts.pyThe script will recreate it on the next run. To reset the cached playlist ID:
rm ~/.spotify_podcast_playlist.json
python queue_podcasts.pyMIT

