I want to print a list of songs (with artist, album, rating and, if possible, number of plays and duration) from my Google Play Music account.
There is no easy way to do this from the app. Doing print-screens as I page through a long list of songs is not tenable.
I would be happy with an export of data to a standard format (plain text, CSV, XML, etc.) that I can manipulate myself.
Any suggestions?
Best Answer
Notice: While this answer is still completely accurate, now Google is phasing out Google Play Music in favor of YouTube Music. If you use their automatic converter, your playlists (including uploaded music) will be retained in YouTube Music. Unfortunately uploaded songs are not visible in shared playlists there either. So I made an equivalent script to the below for YouTube Music.
Modifying darkliquid's answer, I came up with the following which allows for multiple playlists to be saved at once.
Instructions:
JSON.stringify(tracklistObj, null, '\t')
(change the'\t'
to' '
if you want minimal indentation) ortracklistObj
if you just want the JavaScript object to manipulate it your own way. If you want it sorted, run the commandObject.values(tracklistObj).forEach(a => a.sort())
before calling theJSON.stringify
command.Be careful to not refresh the page before you've completed all that you want to do or else you'll have to restart from step 1.
You can also print out track names to the console as you go by changing
printTracksToConsole
totrue
(you should do this between steps 2 and 3).Note that you can probably ignore all GET and POST errors in the console (these are generated by Play Music itself, not this script).
Also note that currently it's setup only to give
Artist - Track name
, but you can easily edit the line that hastracklistObj[currentPlaylist].push(artist + " - " + title);
withalbum
,playCount
,duration
, orrating
, and/or whatever formatting you want (including CSV format if you so please). Do this before step 2.Example output (all Google Play playlists I currently have) with default settings. It took about 5 minutes in total to navigate to each of the 32 playlists, scroll down them, and then convert the result to text.
P.S. You might be interested using a site I found called Tune My Music to make YouTube playlists (but YouTube restricts playlist creation to 10 a day) from the output so your friends can listen to your Google Playlists. If you do this, you probably want to use something like TextMechanic to remove the quotes and
.mp3
from the outputted list.