I like having an online music server. At home, I use a Logitech Media Server (formerly Squeezebox Server)  and run my several O2 Jogglers around the house with the “Squeezeplay OS”  images to play music from that server, but when it comes to an Android tablet (or Android phone), there’s not that joined-up thinking from Logitech (although you can just about cobble it together using a few 3rd party apps ), but what I do like is the Google Play Music service.
Google Play Music  was the first product from the Google Play team after they rebranded to “Google Play”, and I pretty quickly got interested in it. I installed the Google Play Uploader  on my home server, and uploaded all my music (apparently, I’m up to 12,000 tracks, but I think there are some duplicates there!) but what to do about the rest of the family? Well, until just recently, it didn’t matter. Jules has no interest in playing music on her phone or tablet, and Daniel, well, he’s 3-and-a-bit.
Since pretty early on, he’s been all over our tech – initially just using whatever apps we had installed on Jules’ and my phones, then Jules’ tablet (I was, and still am, pretty cautious about him using my tablet as it’s an Asus TF300T  which cost quite a lot of money, and I keep toying with the idea of installing some other OS – like Firefox OS  or Ubuntu Touch  on there and can’t if it’s wrecked), and now he’s pretty comfortable with browsing YouTube or the Play Store, although he knows not to click on adverts and can’t install anything that costs anything.
In the last couple of months, since he’s been really learning how to spell, he’s been asking how to spell the names of his favourite films (“Oliver!”, “Frozen” and “The Polar Express” primarily) to get the film clips up in YouTube, or to play snippets from the soundtracks of the films… which got me thinking. I can’t really do much about the films (not yet at least!), but perhaps I could set up Google Play Music with the soundtracks he listens to… but I already have one account sync’ed with Google Play Music from my media server…. how do I get his stuff set up on there?
Essentially, Google Play Music Uploader is a GUI application that can’t be started in the CLI (which kinda makes sense from a simplicity perspective), but as I’m already running one instance of the application on my media server, I can’t start up a second one, so what do I do?
Well, as it turns out, there’s actually a python library for interacting with Google Play Music’s upload and download applications called “gmusicapi” , and this couples with a really nice wrapper gives me a CLI utility I can run in a CRON job on my media server.
The wrapper is called gmusicapi-scripts , which contains 3 utilities – gmdownload.py, gmsync.py and the key to this – gmupload.py.
You need to install a few libraries. On my Ubuntu 14.04 system, I needed to run:
sudo apt-get install python-pip avconv-tools
sudo pip install gmusicapi
sudo pip install docopt
Once you’ve got this, you can get the tools themselves like this:
git clone https://github.com/thebigmunch/gmusicapi-scripts.git
This will give you a folder called gmusicapi-scripts in which is gmupload.py – the first time you run it, it’ll ask you to visit a web page in order to register the client. Click “OK” to approve the library having access to Google Play Music. This is a pretty spartan page, and ends up with a grey text box containing a string. Copy the contents of that box back into your terminal, and hey-presto, you get it working…
Well, sort of. For me, because I’d not set Daniel up with Google Play Music yet, I needed to set up his account first. I didn’t realise this (I thought, just going to the web page the script points you to will get you access, but it doesn’t because they need to vet which country you’re accessing from…) and the script didn’t tell me that (it just kept saying “Not Subscribed” )
Anyway, once it’s done you run
( 1/1) Successfully uploaded /path/to/file.mp3
If you’ve got multiple users, you can rename ~/.local/share/gmusicapi/oauth.cred to ~/.local/share/gmusicapi/SomeOtherName.cred and then run
~/gmusicapi-scripts/gmupload.py -c SomeOtherName /path/to/file.mp3
Subsequent passes will prompt you to authenticate the next account as you go, and then you can rename them as appropriate.
 Logitech Media Server (formerly Squeezebox Server): http://www.mysqueezebox.com/download
 “Squeezeplay OS”: http://birdslikewires.co.uk/articles/squeezeplay-os
 a few 3rd party apps: I got it working on my TF300T by combining https://play.google.com/store/apps/details?id=de.bluegaspode.squeezeplayer and https://play.google.com/store/apps/details?id=de.cedata.android.squeezecommander
 Google Play Music: https://play.google.com/music
 Google Play Uploader: https://play.google.com/music/listen?u=0#/manager
 TF300T: http://en.wikipedia.org/wiki/Asus_Transformer_Pad_TF300T
 Firefox OS: https://www.mozilla.org/en-US/firefox/os/
 Ubuntu Touch: http://www.ubuntu.com/tablet
 “gmusicapi”: https://github.com/simon-weber/Unofficial-Google-Music-API
 gmusicapi-scripts: https://github.com/thebigmunch/gmusicapi-scripts
 “Not Subscribed”: I raised a bug, but the lead developer said it seemed obvious to him that you have to set it up first… not disputing that for the first pass, but a nice message would have been good :) https://github.com/thebigmunch/gmusicapi-scripts/issues/22