I am not a very good programmer. I do not understand Spotify's API quite yet. Because of this shortfall, I simply used Spotify's Web API. If you want to mix up your current playlist or convert Spotify's amazing "Discover Weekly" playlist, here are some general steps. The playlist user for the Discover Weekly is "spotify."
You can grab any URI from the Spotify API or from the web browser itself.
- Get a List of Current User's Playlists
- Get a Playlist's Tracks, items.track.uri
- Put in Notepad++, find all in current document ----> "uri" or Excel and filter by contains "spotify"
- Put in Excel, separate by colon, add one column of ---->=RANDBETWEEN(0,$numberOfSongs)
- Sort by the new column(s)
- New column, first row----> =a2 =NewColumnFirstRow&","&A3
- Create a Playlist
- Add Tracks to a Playlist with the last row from the new column
Additional Code to "randomize" playlist manually
I have found that the shuffle on Spotify is not the best. So, I did this bit for three column sort and random.
Spotify search string:
- items.track.album.artists, items.track(name,uri)
Regex find & replace in notepad++:
- "name" | "uri" : "spotify:track:
- Line .* "
- =IF(B1<2,B1+1,1) =IF(B1=1,A1&","&A2,"") =FIND("name",A2,1) -->highlight greater than zero
- ID 1+1
- =randbetween(1,3) -->Column sort
Using CURL and JQ
Create a CURL request from the WebAPI
cat spotify.txt | jq '.items.track.name,.items.track.uri,.items.track.album.artists.name'
- "Light Up The Sky"\