Skip to content

matlockx/spotify-playlist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spotify-playlist

Creates a new playlist for your 'Discover Weekly' playlist from spotify with the new name 'DiscoverWeekly_[CurrentYear]_[CurrentCalendarWeek], e.g. 'DiscoverWeekly_2015_43'.

You must run it every week otherwise you will not get the newest playlists any more (create a cron job, run it manually, change the code to run with a scheduler, etc.)

###How to run

1. Create Spotify App

2. Docker

Docker Image: https://hub.docker.com/r/matlockx/spotify-playlist/

docker run -d -e "USER=[YOUR_SPOTIFY_USER_NAME]" -e "CLIENT_ID=[YOUR_CLIENT_ID]" -e "CLIENT_SECRET=[YOUR_CLIENT_SECRET]" -p 8080:8080 matlockx/spotify-playlist

Open your browser at http://localhost:8080/create-playlist or http://[boot2docker_ip]:8080/create-playlist

When you run it for the first time and you open the browser you need to login to spotify with your username and password and you need to allow the requested grants. Currently these are requested:

  • playlist-read-private
  • playlist-read-collaborative
  • playlist-modify-public
  • playlist-modify-private

I don't know whether you need all of them (I'm too lazy to look it up) but you need at least the private permissions otherwise the playlist cannot be created.


Run it directly

Create virtual environment:

mkdir ~/.virtualenvs
pyvenv-3.5 ~/.virtualenvs/spotify
source ~/.virtualenvs/spotify/bin/activate
pip install -r requirements.txt

Create a small bash script, e.g. run.sh:

#!/usr/bin/env bash

export CLIENT_ID=[YOUR_CLIENT_ID]
export CLIENT_SECRET=[YOUR_CLIENT_SECRET]
export USER=[YOUR_SPOTIFY_USER_NAME]

open http://localhost:8080/create-playlist && python -m bottle -b 0.0.0.0:8080 main --debug

Run it:

chmod +x run.sh
./run.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages