gmusic

package module
v0.0.0-...-ad078cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2015 License: MIT Imports: 13 Imported by: 3

Documentation

Overview

Package gmusic provides methods to list and play music from Google Play Music.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GMusic

type GMusic struct {
	DeviceID string
	Auth     string
}

func Login

func Login(username, password string) (*GMusic, error)

Login logs in with a username and password and androidID from a MAC address of the machine.

func LoginAndroid

func LoginAndroid(username, password, androidID string) (*GMusic, error)

LoginAndroid logs in with a username and password and given androidID.

func (*GMusic) GetStream

func (g *GMusic) GetStream(songID string) (*http.Response, error)

GetStream returns a http.Response with a Body streamed as an MP3.

func (*GMusic) ListPlaylistEntries

func (g *GMusic) ListPlaylistEntries() ([]*PlaylistEntry, error)

func (*GMusic) ListPlaylists

func (g *GMusic) ListPlaylists() ([]*Playlist, error)

func (*GMusic) ListTracks

func (g *GMusic) ListTracks() ([]*Track, error)

type ListPlaylistEntries

type ListPlaylistEntries struct {
	Data struct {
		Items []*PlaylistEntry `json:"items"`
	} `json:"data"`
	Kind          string `json:"kind"`
	NextPageToken string `json:"nextPageToken"`
}

type ListPlaylists

type ListPlaylists struct {
	Data struct {
		Items []*Playlist `json:"items"`
	} `json:"data"`
	Kind string `json:"kind"`
}

type ListTracks

type ListTracks struct {
	Data struct {
		Items []*Track `json:"items"`
	} `json:"data"`
	Kind          string `json:"kind"`
	NextPageToken string `json:"nextPageToken"`
}

type Playlist

type Playlist struct {
	AccessControlled      bool   `json:"accessControlled"`
	CreationTimestamp     string `json:"creationTimestamp"`
	Deleted               bool   `json:"deleted"`
	ID                    string `json:"id"`
	Kind                  string `json:"kind"`
	LastModifiedTimestamp string `json:"lastModifiedTimestamp"`
	Name                  string `json:"name"`
	OwnerName             string `json:"ownerName"`
	OwnerProfilePhotoUrl  string `json:"ownerProfilePhotoUrl"`
	RecentTimestamp       string `json:"recentTimestamp"`
	ShareToken            string `json:"shareToken"`
	Type                  string `json:"type"`
}

type PlaylistEntry

type PlaylistEntry struct {
	AbsolutePosition      string `json:"absolutePosition"`
	ClientId              string `json:"clientId"`
	CreationTimestamp     string `json:"creationTimestamp"`
	Deleted               bool   `json:"deleted"`
	ID                    string `json:"id"`
	Kind                  string `json:"kind"`
	LastModifiedTimestamp string `json:"lastModifiedTimestamp"`
	PlaylistId            string `json:"playlistId"`
	Source                string `json:"source"`
	TrackId               string `json:"trackId"`
}

type Settings

type Settings struct {
	EntitlementInfo struct {
		ExpirationMillis int  `json:"expirationMillis"`
		IsCanceled       bool `json:"isCanceled"`
		IsSubscription   bool `json:"isSubscription"`
		IsTrial          bool `json:"isTrial"`
	} `json:"entitlementInfo"`
	Lab []struct {
		Description    string `json:"description"`
		DisplayName    string `json:"displayName"`
		Enabled        bool   `json:"enabled"`
		ExperimentName string `json:"experimentName"`
	} `json:"lab"`
	MaxUploadedTracks      int  `json:"maxUploadedTracks"`
	SubscriptionNewsletter bool `json:"subscriptionNewsletter"`
	UploadDevice           []struct {
		DeviceType             int    `json:"deviceType"`
		ID                     string `json:"id"`
		LastAccessedFormatted  string `json:"lastAccessedFormatted"`
		LastAccessedTimeMillis int    `json:"lastAccessedTimeMillis"`
		LastEventTimeMillis    int    `json:"lastEventTimeMillis"`
		Name                   string `json:"name"`
	} `json:"uploadDevice"`
}

type SettingsData

type SettingsData struct {
	Settings Settings `json:"settings"`
}

type Track

type Track struct {
	Album       string `json:"album"`
	AlbumArtRef []struct {
		URL string `json:"url"`
	} `json:"albumArtRef"`
	AlbumArtist  string `json:"albumArtist"`
	AlbumId      string `json:"albumId"`
	Artist       string `json:"artist"`
	ArtistArtRef []struct {
		URL string `json:"url"`
	} `json:"artistArtRef"`
	ArtistId              []string `json:"artistId"`
	ClientId              string   `json:"clientId"`
	CreationTimestamp     string   `json:"creationTimestamp"`
	Deleted               bool     `json:"deleted"`
	DiscNumber            float64  `json:"discNumber"`
	DurationMillis        string   `json:"durationMillis"`
	EstimatedSize         string   `json:"estimatedSize"`
	ID                    string   `json:"id"`
	Kind                  string   `json:"kind"`
	LastModifiedTimestamp string   `json:"lastModifiedTimestamp"`
	Nid                   string   `json:"nid"`
	PlayCount             float64  `json:"playCount"`
	RecentTimestamp       string   `json:"recentTimestamp"`
	StoreId               string   `json:"storeId"`
	Title                 string   `json:"title"`
	TrackNumber           float64  `json:"trackNumber"`
	TrackType             string   `json:"trackType"`
	Year                  float64  `json:"year"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL