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
- 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)
- Install required packages:
pip install -r requirements.txt
- Create a
.env
file in the project directory with your Spotify credentials:
SPOTIFY_CLIENT_ID=your_client_id_here
SPOTIFY_CLIENT_SECRET=your_client_secret_here
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):
python script.py
Show all available options:
python script.py --help
Available options:
--days
: Number of days to look back for new releases (default: 7)--playlist-name
: Custom name for the playlist (default: "New Releases YYYY-MM-DD")--public
: Make the playlist public (default: private)--delay
: Delay between API calls in seconds (default: 0.1)
Create a playlist with releases from the last 14 days:
python script.py --days 14
Create a public playlist with a custom name:
python script.py --public --playlist-name "My Fresh Tracks"
Create a playlist with releases from the last month:
python script.py --days 30 --playlist-name "Monthly New Releases"
When 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
.env
file - Check that the redirect URI in your Spotify App settings matches exactly:
http://localhost:8888/callback
- Try deleting the
.cache
file and running the script again
If you encounter rate limiting issues:
- Increase the delay between API calls:
--delay 0.2
or 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.
GLWTS