Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
/ srf2spotify Public archive

create spotify playlist from swiss radio (SRF) programme

Notifications You must be signed in to change notification settings

arska/srf2spotify

Repository files navigation

Spotify playlist sync/update

This project started with SRF2spotify, later jouluradio2spotify and radiorock2spotify was added

SRF2Spotify

Swiss radio SRF has a nicely compiled weekly "rock special" programme that I have been listening to as podcast. I'd like to create a playlist and shuffle though the songs in spotify.

playlists

usage

see python srf2spotify.py -h for parameter usage

  • if you don't want to install dependencies system-wide: sudo pip install virtualenv; virtualenv venv; source venv/bin/activate
  • pip install --allow-all-external -r requirements.txt
  • register yourself at https://developer.spotify.com/my-applications, enter "http://localhost/" for the "Redirect URIs" (it is fine if you don't have a webserver running)
  • create an .env file with the following contents:
SPOTIPY_CLIENT_ID='your client ID from developer.spotify.com'
SPOTIPY_CLIENT_SECRET='your client secret from developer.spotify.com'
SPOTIPY_REDIRECT_URI='http://localhost/'
SPOTIPY_CACHE=''
SPOTIFY_USERNAME='your spotify username'
  • run the script with env $(cat .env | xargs) python srf2spotify.py $SPOTIFY_USERNAME <podcast feed url> (see more options with -h)
  • when first run the script will ask you to authorize the client_id for your spotifyusername by visiting a spotify URL (you will be asked if you want to allow your developer account to access your spotify account), then you will be redirected to your SPOTIPY_REDIRECT_URI with the authorization code appended, e.g. http://localhost/?code=..., copy-and-paste that URL to the terminal
  • copy the contents of .cache-<spotifyusername> ({"access_token": ...}) into SPOTIPY_CACHE='{"access_token": ...}' in .env
  • I like to run my stuff locally with heroku local:run sh cron.sh
  • To try stuff faster run heroku run sh cron.sh (you need to have set up heroku with all the configuration values from .env separately)

result

  • see cron.sh for examples
  • the examples are run daily on a heroku free instance

Jouluradio2spotify

In Xmas-time there is a finnish radio playing only Xmas-music

usage

see above for details, see cron-hourly.sh for examples

result

Radiorock2spotify

a fried asked to do playlists for a radiorock.fi show as well

result

About

create spotify playlist from swiss radio (SRF) programme

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages