Announcements
The Spotify Stars Program: Celebrating Values Week!

Help Wizard

Step 1

NEXT STEP

Export Playlist / Backup

Solved!

Export Playlist / Backup

I didn't want to put this in the New Idea section, as I am not really suggesting a new idea.

 

I started deleting a lot of the mp3s off of my computer in favor of just listening to the same songs over Spotify.  I needed the extra hard drive space because I still have a Windows XP computer.

 

I have no use for listening to music offline as I only have a desktop computer and can't currently even burn CDs with this lousy PC.  I can't afford Spotify Premium anyway and have no devices to listen to it on.

 

I wanted to know if there was any way to make a backup of the Spotify playlists.  I was thinking of a simple playlist file that could be exported to your computer as backup.  I have noticed a lot topics on here having to do with playlists accidentally being deleted or disappearing and it has made me nervous.  I don't want that to happen to me now that I have begun migrating to Spotify and away from mp3s.

 

 

Reply
92 Replies

This website works really well as well:

soundiiz.com

 

Kindly,

Ken

 

This website works really well for exporting playlists and converting them between various music sites:

 

soundiiz.com

 

Kindly,

Ken

 

Hi!

 

@SpotMyBackup

Thank you very much for your excellent SpotMyBackup. I have one request: Is it possible to export the urls of all my playlists only? Not the urls of the tracks of each playlist! Just the url of each playlist.  Can this been done somehow from your application?

Hi,
there is no button to do this yet but we work with that data in the background. If you are not afraid to open the developer console in your browser i can show you how you can get that information using spotmybackup.com.

After you logged in with your spotify cccount you have to open the developer console. On chrome you can do this with keyboard button F12 (or use the settings menu). Enter the code at the end of the post into the console window and press enter. The code sends a request to the spotify server using your login information and outputs your playlists urls in the console (the first line of the output is the complete response data structure if you are interessted in names etc.). You now only have to copy & paste this output in a file.

I hope this helps you!

[CODE:]
$.ajax({
method: "GET",
url: 'https://api.spotify.com/v1/users/' + userId + '/playlists',
contentType: 'application/json',
headers: {
'Authorization': 'Bearer ' + token
},
success: function(response) {
console.log(response);
$.each(response.items, function (index, item) {
console.log(item.href);
});
},
fail: function () {
console.log('err');
}
});

Thank you very very much for your answer and help! It works!!!!

I have only one problem: it returns only 20 playlists... I have 88 it total. Do I have to do something more?

 

And one more thing: It returns address like

 

https://api.spotify.com/v1/users/(username)/playlists/2QGLqi8xM51javPmyYUROk

 

Is it possible to return address in a format like

 

spotify:user:(username):playlist:2QGLqi8xM51javPmyYUROk

 

Again thank you very much indeed!! You are great!

 

 

 

 

I think spotify has a limit on how many results you receive per request. You should see the range you received if you look at the url string in the response. There should be some offset and limit parameters at the end.
Change the url in the code i send you to something like
'https://api.spotify.com/v1/users/' + userId + '/playlists?offset=0&limit=50'
And do multiple request like
'https://api.spotify.com/v1/users/' + userId + '/playlists?offset=50&limit=50'
'https://api.spotify.com/v1/users/' + userId + '/playlists?offset=100&limit=50'
until you have all results.

I hope this helps!

For the formatting you have to change the "console.log(item.href);" line to console.log("spotify:user:"+userId+":playlist:"+item.id);

In one word:

 

GREAT!!!!!

Thank you so much "Spotmybackup"!! It worked like a charm!!! Thank you again very much for taking the trouble to answer me!

 

And you jasanite thank you very much too! The format of the line is now as I want it!

Thank you again for your replay!

 

Will be too much if I ask for the name of the playlist in front of each line with the playlist url? Something like

 

(playlist name)-spotify:user:(username):playlist:2Yc019j2WEJvH9fzjyIcRn

 

The name should be stored in the name property. So try item.name, i'm sure you figure out how to output it using the code you already have. 😉

Your little application rocks! Thanks.

Is it possible to get all covers as well? So i don't have to get them manually one by one. It would be best if they had the same name as the song.

You could get the images to your playlists pretty easy. In a previous post i mentioned how to get into the developer console of chrome after logging into spotmybackup.com. You could adjust the code to give you the name of the playlist followed by the url where that image is hosted. You could copy&paste that list into a file and use another tool to download all images and save them with that name. Below is the adjusted code ^^ ( each line of the output is a pair of name::image_url )

[CODE:]
$.ajax({
method: "GET",
url: 'https://api.spotify.com/v1/users/' + userId + '/playlists',
contentType: 'application/json',
headers: {
'Authorization': 'Bearer ' + token
},
success: function(response) {
console.log(response);
$.each(response.items, function (index, item) {
var image_url = item.images.length ? item.images[0].url : '';
console.log(item.name+"::"+image_url);
});
},
fail: function () {
console.log('err');
}
});

Thank you very much for the fast reply 🙂

I have another problem though, in about 30 seconds SpotMyBackup finds 27 playlists and 642 tracks on firefox, but afterwards nothing happens, it just says: "

Please wait. Loading your playlists and tracks ..."

(I have waited about 15 minutes on Firefox).

And what I want are the pictures of the songs not the playlists, is this possible? (I tried spotmybackup on the account of my friend and it worked, mine is still not working...)

I have narrowed it down to an error within an playlist, dont know if there is a character withing there somewhere that cases the script to stop.

Here is the playlist and the error:

 

https://play.spotify.com/user/spotify_uk_/playlist/6Jx9TYReeElpkvNWg8AzWm

 

Uncaught TypeError: Cannot read property 'id' of null
at Object.<anonymous> ((index):658)
at Function.each (jquery-1.11.2.min.js:2)
at Object.success ((index):657)
at j (jquery-1.11.2.min.js:2)
at Object.fireWith [as resolveWith] (jquery-1.11.2.min.js:2)
at x (jquery-1.11.2.min.js:4)
at XMLHttpRequest.b (jquery-1.11.2.min.js:4)

Hi,
the position in the code that error points to is:

659 $.each(data.items, function (index, value) {
658 arr.push({ id: value.track.id, uri: value.track.uri });
659 });

That is basically where the list of your tracks gets composed (we have to do it chunk by chunk because thats how the api works). The error indicates that one oft he entries does not contain a track. This might hint to an error inside the data or that we did overlook a special case.

Nonetheless, a dirty way to fix this might be to first do an exist check on the track property "If (value.track) { ... }".

I'll look into it and figure out if i want to update the hosted code. If you host the code yourself you might just want to change that part and try it.

Thanks for the playlist link. That will make it easier to find the error.

Why you need all those permission, lige manage my private playlist?

 

*not "installed"*

Hi, because that is what this service is meant for. It should list playlist-read, playlist-read-private, playlist-modify-public, playlist-modify-private, user-library-read, user-library-modify.

Can you write a code which allows me to download all cover art for each song in a playlist? It would be optimal if the pictures had the songtitle in their name. (Or just a list of links).

Suggested posts