Fetches data from source and updates a Spotify playlist. If the data fetching or playlist updating fails, it sends an email notification.
In this case the source for playlist is the Turbo Top chartlist (see https://player.antyradio.pl/Turbo-Top)
graph TD
A[Fetch Chartlist Data] --> B{Is Chartlist Data Valid?}
B -->|No| C[Send Failure Email]
B -->|Yes| D[Connect to Spotify]
D --> E[Update Spotify Playlist with Chartlist Data]
-
Initialize Config and Email Sender:
- The configuration file is loaded, and an email sender is prepared.
-
Fetch Turbo Top Data:
- The system retrieves the latest Turbo Top data.
-
Is Data Valid?:
- A check is made to see if the data is valid.
- If No, an email is sent to notify of the failure.
- If Yes, the process continues.
-
Connect to Spotify:
- The system connects to Spotify using the credentials from the configuration.
-
Update Spotify Playlist:
- The Turbo Top playlist is cleared and updated with the new tracks.
- Clone this repository
- Install dependencies from
requirements.txt
- rename
config-template.json
toconfig.json
- update the
config.json
accordingly to your gmail client (see: https://developers.google.com/gmail/api/quickstart/python) and spotify app (see: https://developer.spotify.com/dashboard/) - run
python update_playlist.py