This Python script automates the process of creating a weekly backup playlist of the "Discover Weekly" playlist on Spotify. π It uses the Spotipy library to interact with the Spotify Web API.
Make sure to install the required modules using the following commands:
pip install spotipy
pip install datetime
The script checks if the "Discover Weekly" playlist exists in the user's Spotify profile. If the playlist does not exist, it informs the user that there is no "Discover Weekly" playlist. If the playlist already exists, it creates a new playlist with the name "Weekly Playlist - Week XX (YYYY-MM)" (where "XX" represents the current week number and "YYYY-MM" represents the year and month). π
After creating the backup playlist, the script copies all the songs from the "Discover Weekly" playlist to the newly created backup playlist. This ensures that your favorite weekly recommendations are saved for future listening. π§
To use this script, you need to set up your Spotify client information:
client_id = 'YOUR_CLIENT_ID'
client_secret = 'YOUR_CLIENT_SECRET'
To run the script, execute the following command:
python Spotify_Weekly_Playlist.py
The script requires proper authentication using Spotify's OAuth flow and may need to be authorized with the necessary scopes to perform playlist-related actions.
Please ensure that you have your Spotify credentials and authentication details set up correctly before running the script. π
If you encounter any issues or errors, the script will display appropriate error messages to help troubleshoot the problem.
Please note that this script was made by Thomas Mirbey. If you have any questions or need further assistance, feel free to reach out via Discord (tfx_) or visit my GitHub https://github.com/ThomasM2568. Happy music listening! π΅