deezer

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	Title       string `json:"title"`
	Cover       string `json:"cover"`
	CoverSmall  string `json:"cover_small"`
	CoverMedium string `json:"cover_medium"`
	CoverBig    string `json:"cover_big"`
	CoverXL     string `json:"cover_xl"`
}

Album represents an album on Deezer

type Artist

type Artist struct {
	Name string `json:"name"`
}

Artist represents an artist on Deezer

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a Deezer client

func NewClient

func NewClient(deezerARL, spotifyClientID, spotifyClientSecret string) (client *Client)

NewClient returns a new Deezer Client

func (*Client) GetTrackByID

func (client *Client) GetTrackByID(trackID string) (track common.Track, err error)

GetTrackByID returns the populated track with the provided ID on Deezer

func (*Client) PopulateMetadata

func (client *Client) PopulateMetadata(dTrack *Track) (err error)

PopulateMetadata populates the required metadata for downloading the track

func (*Client) SearchTrack

func (client *Client) SearchTrack(track, artist string) ([]common.Track, error)

SearchTrack takes the track title and optional track's artist query and returns the best match track on Deezer

type Track

type Track struct {
	StreamURL   string
	BlowfishKey []byte
	// contains filtered or unexported fields
}

Track represents a track on Deezer

func (*Track) Album

func (track *Track) Album() string

Album returns the track's album title

func (*Track) Artist

func (track *Track) Artist() string

Artist returns the track's main artist

func (*Track) Artists

func (track *Track) Artists() string

Artists returns the track's contributors' name, comma-separated

func (*Track) CoverURL

func (track *Track) CoverURL() string

CoverURL returns the URL to track's cover art

func (*Track) Download

func (track *Track) Download() (stream io.ReadCloser, err error)

Download returns a mp3 stream of the track

func (*Track) Duration

func (track *Track) Duration() int

Duration returns the track's duration

func (*Track) ID

func (track *Track) ID() string

ID returns the track's ID number on Deezer

func (*Track) ISRC

func (track *Track) ISRC() string

ISRC returns the track's ISRC ID

func (*Track) PlayID

func (track *Track) PlayID() string

PlayID returns a random string which is unique to this instance of Track

func (*Track) Populate

func (track *Track) Populate() (err error)

Populate populates track metadata for Download

func (*Track) SetSpotifyURI

func (track *Track) SetSpotifyURI(sURI string)

SetSpotifyURI set the track's SpotifyURI with the provided one

func (*Track) Source

func (track *Track) Source() int

Source returns the track's source

func (*Track) SpotifyURI

func (track *Track) SpotifyURI() string

SpotifyURI returns the track's equivalent spotify song, if known

func (*Track) Title

func (track *Track) Title() string

Title returns the track's title

Jump to

Keyboard shortcuts

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