
Automatically refresh a Spotify playlist with the latest episode from a curated list of news podcasts
- Why This Exists
- Setup Guide (Get Your Own Running)
- Step 1: Fork this Repository
- Step 2: Create a Spotify Developer Application
- Step 3: Generate your Spotify Refresh Token
- Step 4: Add GitHub Secrets to your Fork
- Step 5: Configure your Playlist and Lineup
- Step 6: Enable GitHub Actions
- Step 7: Access Your Live Dashboard
- Step 8: Authenticate Your Dashboard
- How It Works
- Workflow Schedule
- Run Locally
Google Assistant's old "Play the news" behavior is broken or unreliable for many users. This project serves as a modern replacement: it keeps a dedicated Spotify playlist updated with the latest news podcast episodes so you can get a fresh briefing on demand
You can trigger playback with a Gemini or Google Assistant routine to emulate the same "Play the news" experience (for example, a voice or scheduled routine that starts this specific playlist)
This repo contains:
config.json: Centralized configuration file holding your playlist ID and podcast sourcessync_news.py: Python script that reads the configuration, fetches the newest episode from each show, and replaces playlist items.github/workflows/sync.yml: GitHub Actions workflow that executes the script on an automated schedule
Follow these steps to deploy this automated sync tool on your own GitHub account.
- Scroll to the top right of this page and click the Fork button
- Uncheck "Copy the main branch only" if you want all assets, then click Create fork
To talk to the Spotify API, you need credentials:
- Go to the Spotify Developer Dashboard and log in with your Spotify account.
- Click Create App
- Name your app (e.g.
Daily News Briefing) and give it a description - Crucial: In the Redirect URIs field, enter
http://localhost:8080(this is required for Step 3) - Check the Developer Terms of Service box and click Save
- On your new app dashboard, click Settings - Copy your Client ID and Client Secret somewhere safe
Because this script runs automatically without human intervention, it needs a long-lived Refresh Token authorized to modify your playlists
-
Paste this URL into your browser, replacing
YOUR_CLIENT_IDwith the Client ID from Step 2:https://accounts.spotify.com/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=http://localhost:8080&scope=playlist-modify-public%20playlist-modify-private -
Log in and click Agree to authorize your app
-
Your browser will redirect to an error page or a blank page loading
http://localhost:8080/?code=AQ.... -
Copy the long code sequence right after
?code=in your browser's address bar (exclude any trailing parameters like&state=) -
Open your terminal and exchange that code for your tokens by running this command (replace placeholders):
curl -H "Authorization: Basic $(echo -n 'YOUR_CLIENT_ID:YOUR_CLIENT_SECRET' | base64)" -d grant_type=authorization_code -d code=YOUR_CODE_FROM_URL -d redirect_uri=http://localhost:8080 https://accounts.spotify.com/api/token -
Look closely at the JSON response and copy the
refresh_tokenstring
To keep your tokens safe, add them as repository secrets instead of hardcoding them:
- In your forked GitHub repository, click on Settings (the gear icon at the top)
- On the left sidebar, navigate to Secrets and variables -> Actions
- Click the New repository secret button and add the following three secrets:
SPOTIFY_CLIENT_IDSPOTIFY_CLIENT_SECRETSPOTIFY_REFRESH_TOKEN
- Create a brand new public or private playlist in your Spotify app (e.g. "My Daily Briefing")
- Copy the Playlist ID
You can get this by clicking Share -> Copy link to playlist (the ID is the long string of characters between/playlist/and?si=) - In your GitHub repository repository, open
config.json - Click the Pencil Icon (Edit this file) to swap out the placeholder playlist ID and add your favorite podcast show URLs (see the guide below)
- Click Commit changes... to save
By default, GitHub disables workflows on forked repositories to prevent accidental usage
- Click on the Actions tab at the top of your repository page
- Click the green button that says "I understand my workflows, go ahead and enable them"
The visual status dashboard can be hosted completely free on GitHub Pages:
- Go to Settings -> Pages in your repository
- Under Build and deployment, set the Source to Deploy from a branch
- Select your primary branch (e.g.
main) then click Save - Once GitHub builds the site (usually takes 1-2 minutes), your personal dashboard will be publicly accessible at:
https://<YOUR_GITHUB_USERNAME>.github.io/<YOUR_REPOSITORY_NAME>/dashboard/
The live dashboard runs completely inside your browser and can talk directly to your GitHub repository to update your podcast order visually
To grant it access:
- Click your profile picture at the top right of GitHub.com -> Settings -> Developer settings (at the very bottom of the left sidebar)
- Navigate to Personal access tokens -> Fine-grained tokens and click Generate new token
- Name your token (e.g.
Spotify Dashboard Config), and set your preferred expiration - Under Repository access, choose Only select repositories and pick your forked
Spotify-Daily-Briefingrepository - Under Permissions, click the Repository permissions dropdown, find Contents, and change its access level to Read and write
- Scroll down, click Generate token, and copy the token string immediately
- Open your personal dashboard URL (from Step 7), paste your token into the GitHub Token field at the top, and click Save Token To Local Storage
Once saved, the dashboard will automatically pull your current lineup
You can drag to reorder, add raw links, or delete shows, then hit Commit Changes to save directly back to your GitHub repository
Important Note on Adblockers: If your podcast preview cards fail to load, display as "Unknown Show," or get stuck on "Fetching metadata," you will need to disable your adblocker (such as uBlock Origin, Privacy Badger, or Brave Shields) for your dashboard page. Adblockers frequently block the Spotify
oembedAPI endpoints used by the dashboard to fetch show titles and artwork
- The GitHub Actions runner triggers the Python script
- The script exchanges your long-lived Spotify Refresh Token for a temporary Access Token
- The script reads
config.jsonto extract your target playlist ID and source links - It loops through the links, requests the single most recent track (
limit=1) from Spotify's catalog for each show, and collects their URIs - It sends an atomic
PUTrequest to the Spotify/itemsendpoint, completely wiping yesterday's tracks and setting up the new lineup in one clean operation
The workflow is configured in .github/workflows/sync.yml and triggers automatically:
- Every hour at minute 0 (
cron: '0 * * * *') to ensure your floating schedule always has current feeds - On manual trigger (
workflow_dispatch) via the "Run workflow" button in your GitHub Actions tab for instant testing
If you want to test the execution locally inside your workspace terminal:
- Export your credentials into your active session:
export SPOTIFY_CLIENT_ID="your_client_id"
export SPOTIFY_CLIENT_SECRET="your_client_secret"
export SPOTIFY_REFRESH_TOKEN="your_refresh_token"- Install dependencies:
pip install requests- Execute the worker sync:
python sync_news.py