Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Import Google Music playlists to Spotify?

Solved!

Import Google Music playlists to Spotify?

I've been with Google Music for about 5 months now. It's gotten progressivly worse with this lastest GUI update. For about a week I could not play anything, now it's uses so much ram it slows down my computer. I just want to listen to my music without issues and do art. That's it. 

 

So I'm trying out Spotify. But I have spent quite a bit of time creating and customizing playlists, I would really like to import them into Spotify while I try it out. I see there are LOTS of people going the other way, good luck to them. 

 

Any suggestions? Or is this not yet possible?

 

Running Windows. 

 

Reply

Accepted Solutions
Marked as solution

After some digging, I've found a possible way to import it through Javascript (Chrome) see complete description here:

 

I have been a paying customer of Google's Play Music service since the beginning, but I decided to give Spotify a try due to all the good things I heard about it. I ended up liking it so much that I decided to make the switch. The only problem was that I had spent a lot of time curating the music I liked on Play Music and there was no obvious way to import those playlists in to Spotify. Luckily I'm not the only one that faced this problem and so after a quick search I found the resources I needed.

I used the javascript snippet from the first answer on this Stack Exchange question. The only modification I made was to replace the '---' with '|'. Here's the snippet:

var playlist = document.querySelectorAll('.song-table tr.song-row');  
for(var i =0; i<playlist.length ; i++) {  
  var l = playlist[i]; 
  var title = l.querySelectorAll('td[data-col="title"] .content')[0].textContent;
  var artist = l.querySelectorAll('td[data-col="artist"] .content')[0].textContent;
  var album = l.querySelectorAll('td[data-col="album"] .content')[0].textContent;
  console.log(artist + '|' + title + '|' + album); 
}

To use it in Chrome, just open the JavaScript console (Menu > Tools > JavaScript console) while on the tab that contains the playlist you want to export and paste the snippet in. The script will only print out the songs that are visible in the tab. One of the commenters on the question had a good idea. Maximize the browser window and zoom out as much as possible. It will be very difficult to see the songs, but will save you several script executions. Once you press Enter, the script will run and display a nicely formatted list of songs including artist, title and album.

You will need to create a comma-delimited file or list to use in the next step. I used Excel to do that. Copy the output from the console window, open Excel and paste into the first cell. From the Data menu choose Text to Columns and follow the wizard. Once that's complete, you can choose Export from the File menu and then select Change File Type. Under Other File Types choose CSV.

Great, so now that we have the formatted list how do we get it into Spotify? Once again, one of the commenters on the question comes to the rescue with Ivy Is Here. It's a brilliant web app that makes it very easy to upload a comma-delimited file (or just copy/paste comma-delimited values) which it then matches against Spotify's catalog and creates a Spotify playlist for you. All you have to do is copy the playlist and paste it in to the Spotify desktop app. The site has a short tutorial video which explains all steps in detail so I'm not going to cover it here. I strongly encourage you to donate to the developer if you find it useful. I have no affiliation with that site whatsoever, but it's nice to support useful utilities.

The whole process took me approximately 10 minutes. I hope you find it as helpful as I did!

 

Source: http://level9.azurewebsites.net/migrating-from-google-play-music-to-spotify/






Bjorn

Spotify Community newcomer



Spotify Last.FM



If this post was helpful, please add kudos below!

  I'm Dutch, so please pardon my brevity.




View solution in original post

Marked as solution

Works pretty good. I had to modify the code a bit though. IVY gets confused if I use it the way it is. It only found 55 songs out of 311 on one of my playlists. After I modified the code it works a lot better.

 

var playlist = document.querySelectorAll('.song-table tr.song-row');  
for(var i =0; i<playlist.length ; i++) {  
  var l = playlist[i]; 
  var title = l.querySelectorAll('td[data-col="title"] .content')[0].textContent;
  var artist = l.querySelectorAll('td[data-col="artist"] .content')[0].textContent;
   console.log(artist + ',' + title);
}

I just removed any referecing of albums, and changed the | to a comma. Ivy ignores anything else, so it was just getting confused and not finding many song matches. I also didn't use excel. I used Words "Find and Replace" to remove any crap I didn't want. Just leave the artists and song title. Anything else and you get problems. 

For example:

 

Bobby Callender,AUTUMN

Janis Joplin,Summertime (From 'Porgy & Bess')

Zchiew and The Johnny,Let Your Life Be Free

Valet,Kehaar

Matt Skiba & The Sekrets,Angel of Deaf

The Bouncing Souls,Better Things

Basia Bulat,Paris Or Amsterdam

Sun Kil Moon,Ben's My Friend

Thanks for the help! Much happier with Spotify so far. 

 

 

View solution in original post

23 Replies

I haven't seen such an online playlist converter yet. Is there any way to export playlists from Google Play in any format? Then it might be possible to convert a file to a format that other tools could read.

Marked as solution

After some digging, I've found a possible way to import it through Javascript (Chrome) see complete description here:

 

I have been a paying customer of Google's Play Music service since the beginning, but I decided to give Spotify a try due to all the good things I heard about it. I ended up liking it so much that I decided to make the switch. The only problem was that I had spent a lot of time curating the music I liked on Play Music and there was no obvious way to import those playlists in to Spotify. Luckily I'm not the only one that faced this problem and so after a quick search I found the resources I needed.

I used the javascript snippet from the first answer on this Stack Exchange question. The only modification I made was to replace the '---' with '|'. Here's the snippet:

var playlist = document.querySelectorAll('.song-table tr.song-row');  
for(var i =0; i<playlist.length ; i++) {  
  var l = playlist[i]; 
  var title = l.querySelectorAll('td[data-col="title"] .content')[0].textContent;
  var artist = l.querySelectorAll('td[data-col="artist"] .content')[0].textContent;
  var album = l.querySelectorAll('td[data-col="album"] .content')[0].textContent;
  console.log(artist + '|' + title + '|' + album); 
}

To use it in Chrome, just open the JavaScript console (Menu > Tools > JavaScript console) while on the tab that contains the playlist you want to export and paste the snippet in. The script will only print out the songs that are visible in the tab. One of the commenters on the question had a good idea. Maximize the browser window and zoom out as much as possible. It will be very difficult to see the songs, but will save you several script executions. Once you press Enter, the script will run and display a nicely formatted list of songs including artist, title and album.

You will need to create a comma-delimited file or list to use in the next step. I used Excel to do that. Copy the output from the console window, open Excel and paste into the first cell. From the Data menu choose Text to Columns and follow the wizard. Once that's complete, you can choose Export from the File menu and then select Change File Type. Under Other File Types choose CSV.

Great, so now that we have the formatted list how do we get it into Spotify? Once again, one of the commenters on the question comes to the rescue with Ivy Is Here. It's a brilliant web app that makes it very easy to upload a comma-delimited file (or just copy/paste comma-delimited values) which it then matches against Spotify's catalog and creates a Spotify playlist for you. All you have to do is copy the playlist and paste it in to the Spotify desktop app. The site has a short tutorial video which explains all steps in detail so I'm not going to cover it here. I strongly encourage you to donate to the developer if you find it useful. I have no affiliation with that site whatsoever, but it's nice to support useful utilities.

The whole process took me approximately 10 minutes. I hope you find it as helpful as I did!

 

Source: http://level9.azurewebsites.net/migrating-from-google-play-music-to-spotify/






Bjorn

Spotify Community newcomer



Spotify Last.FM



If this post was helpful, please add kudos below!

  I'm Dutch, so please pardon my brevity.




Ivy is also capable to read a plain text file that you can copy & paste there, so if the output of the javascript console in Chrome is already text only, you don't necessarily need a CSV file. The songs should start with artist first, then track title, not the other way round.

 

Furthermore Soundiiz can also import uploaded files to Spotify, it understands XSPF, M3U and the PLS playlist formats in case you find a solution how to export from Google Play in these formats.

Thanks Huijben! Going to give this a go. I'll let you know how it turns out. 

 

Another thought, I have  a large monitor, If I use it horizontally I can get more on screen too. 

 

Marked as solution

Works pretty good. I had to modify the code a bit though. IVY gets confused if I use it the way it is. It only found 55 songs out of 311 on one of my playlists. After I modified the code it works a lot better.

 

var playlist = document.querySelectorAll('.song-table tr.song-row');  
for(var i =0; i<playlist.length ; i++) {  
  var l = playlist[i]; 
  var title = l.querySelectorAll('td[data-col="title"] .content')[0].textContent;
  var artist = l.querySelectorAll('td[data-col="artist"] .content')[0].textContent;
   console.log(artist + ',' + title);
}

I just removed any referecing of albums, and changed the | to a comma. Ivy ignores anything else, so it was just getting confused and not finding many song matches. I also didn't use excel. I used Words "Find and Replace" to remove any crap I didn't want. Just leave the artists and song title. Anything else and you get problems. 

For example:

 

Bobby Callender,AUTUMN

Janis Joplin,Summertime (From 'Porgy & Bess')

Zchiew and The Johnny,Let Your Life Be Free

Valet,Kehaar

Matt Skiba & The Sekrets,Angel of Deaf

The Bouncing Souls,Better Things

Basia Bulat,Paris Or Amsterdam

Sun Kil Moon,Ben's My Friend

Thanks for the help! Much happier with Spotify so far. 

 

 

Unfortunately, none of the posted scripts worked for me. It's possible, based on the dates of the posts, they're out of date. I found a user on github who does have a fully functional script, with various output options. 

 

Courtesty of jmiserez, go to your songs library in Google Play Music, make sure you're at the top of the page, then press F12 in Chrome. In the window that opens, click on "Console". At the prompt (>), paste the following script, then press enter:

 

// Jeremie Miserez <jeremie@miserez.org>, 2016
//
// A little bit of Javascript to let you export your Google Music library, playlists, and album track lists :)
//
// I posted this as an answer here: http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music
//
// 1. Go to: https://play.google.com/music/listen#/all (or your playlist)
//
// 2. Open a developer console (F12 for Chrome). Paste 
//    code below into the console.
//
// 3. All scraped songs are stored in the `allsongs` object
//    and a text version of the list is copied to the clipboard. I recommend running
//    `songsToText("all",true)` afterwards to get the full CSV information.
//
// 4. If you would like the output in a text format, can call
//    the songsToText() function. You can select a style, choose 
//    the format, and if only liked/thumbed up songs should be exported. 
//    The resulting list will then be pasted into the clipboard. 
//    Styles are ` all`, `artist`, `artistalbum`, `artistsong`, 
//    `artistalbumsong`. 
//    CSV will result in a CSV file and can be left out (defaults to false).
//    Likedonly can be left out (defaults to 
//    false) or set to true, and will filter all songs with 
//    ratings greater or equal to 5. 
//    E.g: 
//    - `songsToText("all",true,false)` will export all songs in csv format.
//    - `songsToText("all",true,true)` will export only liked songs in csv format.
//    - `songsToText("artistsong",false,false)` will export all songs as text.
//
// 5. You can then paste the data anywhere you like, for 
//    example http://www.ivyishere.org/ if you want to add the
//    songs or albums to your Spotify account. To make Ivy 
//    recognize full albums, use the "artistalbum" style. For 
//    songs, use the "artistsong" style.

// see my answer here for questions: http://webapps.stackexchange.com/a/73791/77056

var allsongs = []
var outText = "";
var songsToText = function(style, csv, likedonly){
  if (style === undefined){
    console.log("style is undefined.");
    return;
  }
  var csv = csv || false; // defaults to false
  var likedonly = likedonly || false; // defaults to false
  if (likedonly) {
    console.log("Only selecting liked songs");
  }
  if (style == "all" && !csv){
    console.log("Duration, ratings, and playcount will only be exported with the CSV flag");
  }
  outText = "";
  if (csv) {
    if (style == "all") {
      //extra line
      outText = "artist,album,title,duration,playcount,rating,rating_interpretation" + "\n";
    } else if (style == "artist") {
    } else if (style == "artistsong") {
    } else if (style == "artistalbum") {
    } else if (style == "artistalbumsong") {
    } else {
      console.log("style not defined");
    }
  }
  var numEntries = 0;
  var seen = {};
  for (var i = 0; i < allsongs.length; i++) {
    var curr = "";
    var properTitle = allsongs[i].title.replace(/[\n\r!]/g, '').trim();
    if (!likedonly || (likedonly && allsongs[i].rating >= 5)){
      if (csv) {
        if (style == "all") {
          //extra line
          curr += '"' + allsongs[i].artist.replace(/"/g, '""').trim() + '"' + ",";
          curr += '"' + allsongs[i].album.replace(/"/g, '""').trim() + '"' + ",";
          curr += '"' + properTitle.replace(/"/g, '""').trim() + '"' + ",";
          curr += '"' + allsongs[i].duration.replace(/"/g, '""').trim() + '"' + ",";
          curr += '"' + allsongs[i].playcount.replace(/"/g, '""').trim() + '"' + ",";
          curr += '"' + allsongs[i].rating.replace(/"/g, '""').trim() + '"' + ",";
          curr += '"' + allsongs[i].rating_interpretation.replace(/"/g, '""').trim() + '"';
        } else if (style == "artist") {
          curr += '"' + allsongs[i].artist.replace(/"/g, '""').trim() + '"';
        } else if (style == "artistsong") {
          curr += '"' + allsongs[i].artist.replace(/"/g, '""').trim() + '"' + ",";
          curr += '"' + properTitle.replace(/"/g, '""').trim() + '"';
        } else if (style == "artistalbum") {
          curr += '"' + allsongs[i].artist.replace(/"/g, '""').trim() + '"' + ",";
          curr += '"' + allsongs[i].album.replace(/"/g, '""').trim() + '"';
        } else if (style == "artistalbumsong") {
          curr += '"' + allsongs[i].artist.replace(/"/g, '""').trim() + '"' + ",";
          curr += '"' + allsongs[i].album.replace(/"/g, '""').trim() + '"' + ",";
          curr += '"' + properTitle.replace(/"/g, '""').trim() + '"';
        } else {
          console.log("style not defined");
        }
      } else {
        if (style == "all"){
          curr = allsongs[i].artist + " - " + allsongs[i].album + " - " + properTitle + " [[playcount: " + allsongs[i].playcount + ", rating: " + allsongs[i].rating_interpretation + "]]" ;
        } else if (style == "artist"){
          curr = allsongs[i].artist;
        } else if (style == "artistalbum"){
          curr = allsongs[i].artist + " - " + allsongs[i].album;
        } else if (style == "artistsong"){
          curr = allsongs[i].artist + " - " + properTitle;
        } else if (style == "artistalbumsong"){
          curr = allsongs[i].artist + " - " + allsongs[i].album + " - " + properTitle;
        } else {
          console.log("style not defined");
        }
      }
      if (!seen.hasOwnProperty(curr)){ // hashset
        outText = outText + curr + "\n";
        numEntries++;
        seen[curr] = true;
      } else {
        //console.log("Skipping (duplicate) " + curr);
      }
    }
  }
  console.log("=============================================================");
  console.log(outText);
  console.log("=============================================================");
  try {
    copy(outText);
    console.log("copy(outText) to clipboard succeeded.");
  } catch (e) {
    console.log(e);
    console.log("copy(outText) to clipboard failed, please type copy(outText) on the console or copy the log output above.");
  }
  console.log("Done! " + numEntries + " lines in output. Used " + numEntries + " unique entries out of " + allsongs.length + ".");
};
var scrapeSongs = function(){
  var intervalms = 1; //in ms
  var timeoutms = 3000; //in ms
  var retries = timeoutms / intervalms;
  var total = [];
  var seen = {};
  var topId = "";
  document.querySelector("#mainContainer").scrollTop = 0; //scroll to top
  var interval = setInterval(function(){
    var songs = document.querySelectorAll("table.song-table tbody tr.song-row");
    if (songs.length > 0) {
      // detect order
      var colNames = {
        index: -1,
        title: -1,
        duration: -1,
        artist: -1,
        album: -1,
        playcount: -1,
        rating: -1
        };
      for (var i = 0; i < songs[0].childNodes.length; i++) {
        colNames.index = songs[0].childNodes[i].getAttribute("data-col") == "index" ? i : colNames.index;
        colNames.title = songs[0].childNodes[i].getAttribute("data-col") == "title" ? i : colNames.title;
        colNames.duration = songs[0].childNodes[i].getAttribute("data-col") == "duration" ? i : colNames.duration;
        colNames.artist = songs[0].childNodes[i].getAttribute("data-col") == "artist" ? i : colNames.artist;
        colNames.album = songs[0].childNodes[i].getAttribute("data-col") == "album" ? i : colNames.album;
        colNames.playcount = songs[0].childNodes[i].getAttribute("data-col") == "play-count" ? i : colNames.playcount;
        colNames.rating = songs[0].childNodes[i].getAttribute("data-col") == "rating" ? i : colNames.rating;
      }
      // check if page has updated/scrolled
      var currId = songs[0].getAttribute("data-id");
      if (currId == topId){ // page has not yet changed
        retries--;
        scrollDiv = document.querySelector("#mainContainer");
        isAtBottom = scrollDiv.scrollTop == (scrollDiv.scrollHeight - scrollDiv.offsetHeight)
        if (isAtBottom || retries <= 0) {
          clearInterval(interval); //done
          allsongs = total;
          console.log("Got " + total.length + " songs and stored them in the allsongs variable.");
          console.log("Calling songsToText with style all, csv flag true, likedonly false: songsToText(\"all\", false).");
          songsToText("artistalbumsong", false, false);
        }
      } else {
        retries = timeoutms / intervalms;
        topId = currId;
        // read page
        for (var i = 0; i < songs.length; i++) {
          var curr = {
            dataid: songs[i].getAttribute("data-id"),
            index: (colNames.index != -1 ? songs[i].childNodes[colNames.index].textContent : ""),
            title: (colNames.title != -1 ? songs[i].childNodes[colNames.title].textContent : ""),
            duration: (colNames.duration != -1 ? songs[i].childNodes[colNames.duration].textContent : ""),
            artist: (colNames.artist != -1 ? songs[i].childNodes[colNames.artist].textContent : ""),
            album: (colNames.album != -1 ? songs[i].childNodes[colNames.album].textContent : ""),
            playcount: (colNames.playcount != -1 ? songs[i].childNodes[colNames.playcount].textContent : ""),
            rating: (colNames.rating != -1 ? songs[i].childNodes[colNames.rating].getAttribute("data-rating") : ""),
            rating_interpretation: "",
            }
          if(curr.rating == "undefined") {
            curr.rating_interpretation = "never-rated"
          }
          if(curr.rating == "0") {
            curr.rating_interpretation = "not-rated"
          }
          if(curr.rating == "1") {
            curr.rating_interpretation = "thumbs-down"
          }
          if(curr.rating == "5") {
            curr.rating_interpretation = "thumbs-up"
          }
          if (!seen.hasOwnProperty(curr.dataid)){ // hashset
            total.push(curr);
            seen[curr.dataid] = true;
          }
        }
        songs[songs.length-1].scrollIntoView(true); // go to next page
      }
    }
  }, intervalms);
};
scrapeSongs();
// for the full CSV version you can now call songsToText("all", true);

 

When it's done running, you can scroll down and see your entire song list. Select it all, and copy, then paste it into a spreadsheet. You're doing this so you can select your songs in groups of 500. 

 

Select the first 500 songs from your spreadsheet, then go to:

 

http://www.playlist-converter.net/#/

 

Paste in your selection of 500 songs. Click "Convert". When it is done, for your output, select the Spotify URI, then copy all the URI codes it generates.

 

Go to your Spotify app and select "Songs". Then press Cntrl + V. This will add all 500 songs. It will skip any songs you already have in your Spotify library.

 

Now do your next 500 from your spreadsheet, to the playlist converter, to outputting to Spotify URIs, to pasting them into the Spotify app in your songs library. Keep rinsing and repeating.

 

I use 500 songs, as that appears to be the limit on how many Spotify URIs that the playlist converter will spit out at once, regardless of how many songs you had input. 

 

All credit to jmiserez on github. This was a painless way for me to finally move nearly my entire Google Play Music library of thousands of songs to Spotify. 

 

 

 

Thank you very much, your solution is working!

 

I was only able to convert maximum of 100 tracks in playlist-converter at once, otherwise empty playlist is created in Spotify, and playlist-converter page stuck saying "Loading". Playlist can be merged than in Spotify app by selecting them and adding by playlist context menu.

THANK YOU!!!  Worked very well.  

I tried to import several hundred at one time, and it stalled out as suggested by last post.

However, when did in blocks of 100 worked perfectly.

Many, many thanks for all the time you have saved us!!!!

Thank you, worked great! playlist-converter was a little hit or miss for me but I listen to a lot of weird stuff so I just had to go find those manually. Still saved me a bunch of time 😄

Thanks! fueledbygin's solution worked for me. Unlike previous posters, I was able to do 500 at a time.

 

The only issue I ran into was that many of my exports from Chrome had "Buy" at the beginning of the track name. This may be since I no longer subscribe to GPMAA. In any case, I simply did a find and replace "Buy  " (that includes 2 spaces) for blank (i.e. replace Buy with 2 spaces by nothing). That caused most of the ones with "Buy" in the name to be found. 

 

To find the remaining ones more easily, copy and paste the output from Playlist Converter (from the first line with # Source Converted to the bottom) containing the ones found/not found back into a new sheet in Excel. When pasting, right click and choose "paste special," then in the box that pops up choose "unicode text." Then expand the columns out so you can see everything. You'll see blanks in the Converted column. You can paste successive 500 count ouputs below in the same manner. Then just filter the Converted column by "blanks" and you'll have your list of tracks to add manually. Of 706 tracks from my Thumbs Up playlist, the script found 564, leaving me 142 (~20%). Not bad since I mostly listen to electronic/dubstep with lots of remixes. 

Wow. This darn thing actually worked.  I'm donating to this dude.


hans-jürgen schrieb:

 

Furthermore Soundiiz can also import uploaded files to Spotify, it understands XSPF, M3U and the PLS playlist formats in case you find a solution how to export from Google Play in these formats.


Soundiiz has been updated recently, it now also includes Google Play Music and Last.fm again for direct converting of playlists etc For the new advanced features you need to subscribe to them now:

 

https://soundiiz.com/pricing

 

 

I just had to convert a google playlist to spotify, here are my steps:

 

Copy this in your developer console

 

 

copy(Array.from(document.querySelectorAll('.title-col')).map(el => { 
	const title = el.querySelector('.track-title').innerHTML
	const artist = el.querySelector('.artist').innerHTML
	return `${artist} - ${title}`
}).join('\n'))

This will automatically copy the playlist to your clipboard.

 

 

Now insert the playlist here http://spotlistr.herokuapp.com/#/search/textbox

 

Done!

 

(You have to connect your account, but spotlistr seems trustable, since their code is on open source https://github.com/BobNisco/Spotlistr)

@fueledbygin solution worked! I was unable to thumbs up. Thank you so much. This was really driving me nuts!

Just a note that as of 9/20/2017, this method still works (the one fueldbygin posted)! Thanks!

There was a time, when I was facing the same issue got frustrated.
But One day I came across to this really cool Tool 'MusConv'

It Really worked. You can get it here.
https://musconv.com/

UPDATED:

 

function fReplace(thisString, thisThing, thatThing) {
let tLS = thisString;
while(tLS.includes(thisThing)){
tLS = tLS.replace(thisThing, thatThing);
}
return(tLS);
}

var playlist = document.querySelectorAll('.song-table tr.song-row');
var strBuilder = "";
for(var i =0; i<playlist.length ; i++) {
var l = playlist[i];
l.querySelectorAll('td[data-col="title"]')[0].textContent;
var title = l.querySelectorAll('td[data-col="title"]')[0].textContent;
title = encodeURI(title);
title = fReplace(title, "%20%20", "%20");
title = fReplace(title, "Buy%0A%20", "");
title = fReplace(title, "%0A%20", "");
title = fReplace(title, "%0A", "");
title = decodeURI(title);
var artist = l.querySelectorAll('td[data-col="artist"]')[0].textContent;
var album = l.querySelectorAll('td[data-col="album"]')[0].textContent;

strBuilder = strBuilder + artist + '|' + title + '|' + album + '\r\n';
}
console.log(strBuilder);

Thank you! worked perfectly! (on my last day of google music trial :-P)

Hey. Try to use Musconv.com it is an awesome tool that lets you migrate or export from spotify, google music, apple music, iTunes, Pandora, Deezer and many more. 

Suggested posts