uploading music automatically with Google Music on a Linux server

12,128

Solution 1

I think what you appear to be looking for is https://github.com/thebigmunch/gmusicapi-scripts - a set of python scripts to upload, download or bi-directionally sync tracks. This, in turn, draws from https://github.com/simon-weber/Unofficial-Google-Music-API should you wish to use these python libraries for your own projects.

Solution 2

Per user Joachim's, answer describes a command line approach to both installing and setting up for sync, on a headless linux server no less. To wit:

install-gmm-headless.sh

#!/bin/bash
# Uncomment if 32-bits
# wget "http://dl.google.com/linux/direct/google-musicmanager-beta_current_i386.deb" -O /tmp/gmm.deb
 
# Uncomment this is 64-bit
# wget "http://dl.google.com/linux/direct/google-musicmanager-beta_current_amd64.deb" -O /tmp/gmm.deb
 
sudo dpkg -i /tmp/gmm.deb
sudo apt-get -f install
sudo apt-get install x11vnc
 
echo "Now you can must create the headless-script"
echo "Found here: http://development.giaever.org/pastebin/Ubuntu/google-musicmanager/gmm-headless-script.sh"

gmm-headless-script.sh

#!/bin/bash
# Save as: $HOME/gmm-headless-script.sh
 
export DISPLAY=:2
Xvfb :2 -screen 0 1024x768x16 &
google-musicmanager -a GMAILUSER -p PASSWORD -s /path/to/music -m SERVERNAME &
x11vnc -display :2 -bg -nopw -listen localhost -xkb
 
# remember to chmod +x this file = make excutable.
# run in terminal: chmod +x $HOME/gmm-headless-script.sh

From the linked answer:

Hope they are useful. Read comments. Remember to edit: «GMAILUSER -p PASSWORD -s /path/to/music -m SERVERNAME» with you own data. (SERVERNAME could be whatever. Its just a name so you can identify your server from your Google-login.)

Type $HOME/gmm-headless-script.sh in terminal to start sync.

Essentially the scripts:

  • have you download and install the linux version of the google music uploader
  • have you install a x11 server that uses vnc and framebuffer for output so you don't have to actually deal with x11, but the app will be able to run
  • instruct the music uploader to run, specifying the user account and sync from location.

Making this automatic would then be a matter of adding this to cron for repeat syncage, presumably once your initial upload had completed.

A thing to watch out for is excessively long sync / upload times that might lead to overlap of your cronned sync jobs.

Share:
12,128

Related videos on Youtube

wxl
Author by

wxl

hacking bikes, computers, food, and music since 1977

Updated on September 18, 2022

Comments

  • wxl
    wxl almost 2 years

    So I've seen questions like this one looking for help uploading music with Google Music on Linux, but none really seem to confront the notion of solely using the command line. I've downloaded the software from Google and dug around in those files for anything useful but wasn't able to come up with any good solutions.

    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 over 10 years
      What's your question here exactly? If you're looking for a pre-made product to do this for you, that would be considered off-topic. Otherwise the question is pretty vague. You'll probably want to approach this as two different tasks (to start): one for watching the folder and firing a script, and the other for scripting the upload via the Google client.
  • Cfinley
    Cfinley almost 10 years
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
  • Gavin C
    Gavin C almost 10 years
    Fair enough, will copypasta.
  • wxl
    wxl almost 10 years
    Sadly this doesn't work. I think the Google API has changed. I had an exchange with Joachim about it to no avail.