A script that automatically maintains multiple SRF Virus playlists on Spotify.
There are following playlists this application maintains:
Read more below.
This playlist contains currently trending songs played on the SRF Virus radio channel.
The application adds songs to the playlist once they have been played at least three times within one week. If a song is not played at least three times during the following week, it is removed from the playlist.
This playlist contains the current top 100 most-played songs on the SRF Virus radio channel.
The application increments a song’s play count each time it is played. The songs are then sorted by play count. Songs that enter the top 100 and are not yet in the playlist are added. Songs that fall below the top 100 are removed from the playlist. Additionally, if a song has not been played for 10 days, it is removed as well.
This playlist contains songs played on the SRF Virus radio channel during the “Night Out” program. The program airs on Saturdays between 20:00 and 23:59 (CET).
The application adds songs to the playlist once they have been played at least once within three weeks. If a song is not played again within the following three weeks, it is removed from the playlist.
The application runs every 15 minutes. It uses the SRGSSR Audio API to retrieve songs played on the SRF Virus radio channel and the Spotify Web API to manage the playlists.
The application performs the following steps: 1. Retrieve songs from the SRGSSR Audio API 2. Filter out songs that are redundant from the previous request 3. Search the remaining songs on Spotify to obtain the URI (song identifier) 4. Add songs that meet the criteria for the respective playlist 5. Remove songs that no longer meet the criteria
- Python 3.9+
- spotipy (API Wrapper for the Spotify Web API)
This application is not affiliated with SRG SSR or Spotify and is not an official application of one of these companies. The application was developed independently and uses publicly available data in accordance with its terms of use.
Copyright (c) codeofandrin
This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.