GithubHelp home page GithubHelp logo

playmusic's Introduction

Node-JS Google Play Music API

Written by Jamon Terrell [email protected]

This project is not endorsed by of affiliated with Google in any way.

How to Use

Initialization

var PlayMusic = require('../');

var pm = new PlayMusic();

pm.init({email: "[email protected]", password: "password"}, function() {
  // place code here
})

Retrieve List of Songs in your Library, retrieve the stream URL

    pm.getLibrary(function(library) {
        var song = library.data.items.pop();
        console.log(song);
        pm.getStreamUrl(song.id, function(streamUrl) {
            console.log(streamUrl);
        });
    });

Search for a song

    pm.search("bastille lost fire", 5, function(data) {
        var song = data.entries.sort(function(a, b) {
            return a.score < b.score;
        }).shift();
        console.log(song);
        pm.getStreamUrl(song.track.nid, function(streamUrl) {
            console.log(streamUrl);
        });
    }, function(err) {
        console.log(err);
    });

Retrieve Playlists

    pm.getPlayLists(function(data) {
        console.log(data.data.items);
    });

    pm.getPlayListEntries(function(data) {
        console.log(data.data.items);
    });

Retrieve the Stream URL for a song by id

    pm.getStreamUrl("Thvfmp2be3c7kbp6ny4arxckz54", console.log);

Future

  • Externalize all node.js specific code, add base classes for re-usable functionality
    • Implement browser version?
  • Add features
    • complete API
  • Rewrite all responses from services to be more consistent, useful?
  • Suggestions? submit an issue!

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Attribution

Based partially on the work of the Google Play Music resolver for Tomahawk (https://github.com/tomahawk-player/tomahawk-resolvers/blob/master/gmusic/content/contents/code/gmusic.js) and the gmusicapi project by Simon Weber (https://github.com/simon-weber/Unofficial-Google-Music-API/blob/develop/gmusicapi/protocol/mobileclient.py).

playmusic's People

Contributors

jamon avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.