Project

skyjam

0.01
No commit activity in last 3 years
No release in over 3 years
Deftly interact with Google Music (a.k.a Skyjam)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 10.3
~> 2.14

Runtime

~> 0.9
~> 3.0
 Project Readme

ruby-skyjam

Deftly interact with Google Music (a.k.a Skyjam)

Important foreword

This uses the same device id as Google's Music Manager (your MAC address). The reason is that incrementing the MAC is not a globally solving solution and that you most probably won't need Google's Music Manager afterwards because it's, well, “lacking” (to say the least). This may apply to the Chrome extension too but I'm not sure so you'd be best not using it (it's similarly lacking anyway).

On the command line

gem install skyjam     # install the gem
skyjam --auth          # authenticates with OAuth, do it only once
skyjam ~/Music/Skyjam  # download files into the specified directory

Existing files will not be overwritten, so that makes a nice sync/resume solution. Tracks are downloaded atomically, so you're safe to ^C.

Inside ruby

Add 'skyjam' to your Gemfile (you do use Gemfiles?)

Here's a sample of what you can do now:

require 'skyjam'

# where you want to store your library
path = File.join(ENV['HOME'], 'Music/Skyjam')

# Interactive authentication, only needed once.
# This performs OAuth and registers the device
# into Google Music services. Tokens are persisted
# in ~/.config/skyjam
Skyjam::Library.auth

# Connect the library to Google Music services
# This performs an OAuth refresh with persisted
# tokens
lib = Skyjam::Library.connect(path)

puts lib.tracks.count

lib.tracks.take(5).each { |t| puts t.title }  # metadata is exposed as accessors

track = lib.tracks.first
track.download               # atomically download track into the library
track.download               # noop, since now the file exists
track.download(lazy: false)  # forces the download

track.data                # returns track audio data from the file (since it's downloaded)
track.data(remote: true)  # forces remote data fetching

The following snippet also makes for an interesting interactive REPL to interact with Google Music, wich is a testament to the clarity aimed at in this project:

require 'skyjam'
require 'pry'
SkyJam::Library.connect('some/where').pry

Future features

Yes, trouble free upload for the quality minded is coming.

Also, see TODO.

Goals

Have a potent tool that doubles as a library and a documentation of the Google Music API (including ProtoBuf definitions)

References