gmusic

package module
v0.0.0-...-27e302d Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2017 License: MIT Imports: 13 Imported by: 1

Documentation

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) GetTrackInfo

func (g *GMusic) GetTrackInfo(trackID string) (*Track, error)

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 uint64 `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      uint32 `json:"maxUploadedTracks"`
	SubscriptionNewsletter bool   `json:"subscriptionNewsletter"`
	UploadDevice           []struct {
		DeviceType             uint32 `json:"deviceType"`
		ID                     string `json:"id"`
		LastAccessedFormatted  string `json:"lastAccessedFormatted"`
		LastAccessedTimeMillis uint64 `json:"lastAccessedTimeMillis"`
		LastEventTimeMillis    uint64 `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            uint8    `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             uint32   `json:"playCount"`
	RecentTimestamp       string   `json:"recentTimestamp"`
	StoreId               string   `json:"storeId"`
	Title                 string   `json:"title"`
	TrackNumber           uint32   `json:"trackNumber"`
	TrackType             string   `json:"trackType"`
	Year                  uint32   `json:"year"`
}

Jump to

Keyboard shortcuts

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