Create a Spotify Playlist from an Album List

I have a long list of favorite albums. I know that sites like www.spotmysongs.com will take a text file from the list of artists and song titles and create a playlist from them on Spotify, but I would like to do the same with the list of albums, not accepting to list each track on album.

For example, I want to say:

Random Access Cases Daft Punk Cults Cults

and load these two whole albums together into a playlist. Any idea if this is possible or how to do it?

+4
source share
2 answers

You can make a request http://ws.spotify.com/search/1/album?q=daft%20punk%20random%20access%20memories

http://ws.spotify.com/lookup/1/?uri=spotify:albumreadym2880jivSbbyEGAKfITCa&extras=track to get the tracks on this album.

As for adding them to the playlist programmatically, there is currently no official way to do this. However, here is a hack that you can use by opening the web player in the devtools console. The sample code will create a playlist and add a track. You can combine this with the above steps.

window.frames[0].require("$api/models", function(models) { models.Playlist.create("My cool playlist").done( function(playlist) { playlist.load("tracks").done( function(){ playlist.tracks.add( models.Track.fromURI("spotify:track:3KRAqo71NrfR1UCa34JEsy").done(function(){ }) }) }) }) 

You can write a browser extension to do this. Or, assuming you have a large list of JSON tracks that you want to add, you can modify the example above to add all the tracks in sequence.

Alternatively, you can try using something like https://github.com/liesen/spotify-api-server until Spotify starts working together and provides the official API.

+1
source

I think I would introduce a new answer that now works better than apify apif is available. Now you can make supported API calls to create a playlist and add tracks to the playlist .

0
source

Source: https://habr.com/ru/post/1499063/


All Articles