I got very frustrated with Spotify since they decided that a release radar should not actually contain all your followed artist's new releases, but instead be filled with suggestions and ads. This solves this problem and creates a new playlist with all the recent releases of all your followed artists. The code is not pretty, but it works. I believe something similar has been done before, but most of those applications did not fully work for me.
- Creates a playlist with new releases from your followed artists
- Configurable time range (default: last 7 days)
- Handles both albums and singles
- Creates either public or private playlists
- Shows progress and found tracks during execution
- Python 3.x
- Poetry
- A Spotify account
- Spotify Developer credentials (see Setup below)
- Go to Spotify Developer Dashboard
- Log in with your Spotify account
- Click "Create App"
- Fill in the app details:
- App name: just enter any name you like
- App description: optional
- Redirect URI:
http://localhost:8888/callback
- Click "Save"
- On your app's page, note down the following:
- Client ID
- Client Secret (click "Show Client Secret" to reveal it)
Currently on test.pypi
pip install -i https://test.pypi.org/simple/ spotify-actual-release-radarClone the repository. Then:
Poetry is used to manage dependencies. You can install it by:
curl -sSL https://install.python-poetry.org | python3 -
Then just create a virtual environment and install dependencies:
poetry install
You have to authenticate using the client ID and secret from step 1. To do that, either create a .env file like below, or pass in the credentials via
spotify-radar \
--days 7 \
--client-id YOUR_SPOTIFY_CLIENT_ID \
--client-secret YOUR_SPOTIFY_CLIENT_SECRET \
--redirect-uri http://127.0.0.1:8888/callbackor export them as environment variables
export SPOTIFY_CLIENT_ID="YOUR_SPOTIFY_CLIENT_ID"
export SPOTIFY_CLIENT_SECRET="YOUR_SPOTIFY_CLIENT_SECRET"
export SPOTIFY_REDIRECT_URI="http://127.0.0.1:8888/callback"Do not use "localhost", see Spotify security changes.
Run the script with default settings (7 days, private playlist):
spotify-radar --days NShow all available options:
spotify-radar --help--days, -d : Look for releases in the past N days (default: 7)
--public : Make the playlist public (default: private)
--playlist-name : Custom name for the playlist (default: New Releases YYYY-MM-DD)
--delay : Delay between API calls in seconds (default: 0.1)
--client-id : Spotify Client ID (overrides environment variables or .env)
--client-secret : Spotify Client Secret (overrides environment variables or .env)
--redirect-uri : Spotify Redirect URI (overrides environment variables or .env)
--env-file : Path to a .env file containing Spotify credentialsWhen you run the script for the first time:
- It will open your default web browser
- Ask you to log in to Spotify (if not already logged in)
- Request permission to access your Spotify account
- Redirect you to a "connection refused" page (this is normal!)
- Copy the entire URL from your browser
- Paste it back into the terminal when prompted
After the first run, the authentication token will be cached and you won't need to authenticate again unless the token expires.
- Make sure your Client ID and Client Secret are correct in the
.envfile - Check that the redirect URI in your Spotify App settings matches exactly:
http://localhost:8888/callback - Try deleting the
.cachefile and running the script again
If you encounter rate limiting issues:
- Increase the delay between API calls:
--delay 0.2or higher - Wait a few minutes before trying again
- Check that you're following the artists on Spotify
- Try increasing the number of days to look back:
--days 30
Somtimes a restart of Spotify is needed in order to update the playlists.
Not sure what causes this, but loggin out of the Spotify Developer Web Console and loggin back in fixed this for me.