csn

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.4.0

type Client struct {

	//HTTPClient is a proxy-configured client
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client represents a CSN client

func NewClient added in v0.4.0

func NewClient(proxy string) *Client

NewClient returns a new CSN Client

func (*Client) Search added in v0.4.0

func (client *Client) Search(query string) (tracks []common.Track, err error)

Search takes a query string and returns a slice of matching tracks

type Track

type Track struct {
	StreamURL string
	// contains filtered or unexported fields
}

Track represents a track on CSN site

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 CSN

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 the required metadata for downloading the track

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