Save Spotify API JSON data as MPD playlist

I’m having inconsistency with fetching Spotify playlists through mpc, so I’m going to attempt to create a script using the Charts API.

http://charts.spotify.com/api/tracks/most_streamed/gb/daily/latest

Sample data:

  {
     "tracks":[
        {
           "date":"2013-12-15",
           "country":"global",
           "track_url":"https:\/\/play.spotify.com\/track\/7DyuZtvlGT0z5Xz8peiLN7",
           "track_name":"I See Fire",
           "artist_name":"Howard Shore",
           "artist_url":"https:\/\/play.spotify.com\/artist\/6eUKZXaKkcviH0Ku9w2n3V",
           "album_name":"The Hobbit: The Desolation of Smaug (Original Motion Picture Soundtrack)",
           "album_url":"https:\/\/play.spotify.com\/album\/5kqgALc3cz9P3VclmSmHfr",
           "artwork_url":"http:\/\/o.scdn.co\/300\/be7d523ea35aeb10f561712420d3429f0ec68eec",
           "num_streams":515608,
           "window_type": "daily"
        },
        {
           "date":"2013-12-15",
           "country":"global",
           "track_url":"https:\/\/play.spotify.com\/track\/44GgIVlmRsD1qMWONOWOS3",
           "track_name":"Waiting Game",
           "artist_name":"BANKS",
           "artist_url":"https:\/\/play.spotify.com\/artist\/2xe8IXgCTpwHE3eA9hTs4n",
           "album_name":"LONDON",
           "album_url":"https:\/\/play.spotify.com\/album\/4xG1FKMIQPGYRujVBtMAqm",
           "artwork_url":"http:\/\/o.scdn.co\/300\/4027ebaa3c0ff4161020cb37a546f25929249166",
           "num_streams":182325,
           "window_type": "daily"
        }
  }

Any idea on how to save this a mpd playlist?

Can’t you just ‘follow’ the chart playlist in the Spotify Web client so it
appears in your mopidy playlists and then play from that?

Unfortunately not, the chart has no ‘follow’ option in the webclient, only play. Also, I’ve just discovered the API is deprecated.

So, using the develop API, I’m going to grab this top50 instead:

https://play.spotify.com/user/spotify/playlist/5FJXhjdILmRA2z5bvz4nzf

I’d still like to try and manually create the playlist; where is this stored and what syntax does MPD use?

Playlist modification via MPD is not yet supported in Mopidy. But for future reference: http://www.musicpd.org/doc/protocol/.

But you can do it via the HTTP interface, the API is available in the Mopidy documentation.