Documentation ¶
Index ¶
- func URL(ctype ContentType, id string) (link string)
- type Album
- type Artist
- type ChunkDecrypter
- type Client
- func (c *Client) Album(id string) (*Album, error)
- func (c *Client) AlbumsByArtist(id string) ([]Album, error)
- func (c *Client) Artist(id string) (*Artist, error)
- func (c *Client) AvailableQualities(song Song) []Quality
- func (c *Client) Download(song Song, quality Quality) (io.ReadCloser, error)
- func (c *Client) IsQualityAvailable(song Song, quality Quality) bool
- func (c *Client) Lyrics(id string) (*Lyrics, error)
- func (c *Client) Search(query, filter, output string, start, limit int) (*SearchResponse, error)
- func (c *Client) Song(id string) (*Song, error)
- func (c *Client) SongsByAlbum(id string, songLimit int) ([]Song, error)
- type ContentType
- type Contributors
- type DecryptingReader
- type ErrUnexpectedStatusCode
- type ExplicitContent
- type Lyrics
- type Quality
- type SearchResponse
- type Song
- type SyncedLyric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func URL ¶
func URL(ctype ContentType, id string) (link string)
URL returns a URL from a given content type and content id, being essentially the opposite of ParseURL.
Types ¶
type Album ¶
type Album struct { ID string `json:"ALB_ID"` ArtistID string `json:"ART_ID"` ArtistName string `json:"ART_NAME"` LabelName string `json:"LABEL_NAME"` StyleName string `json:"STYLE_NAME"` Title string `json:"ALB_TITLE"` Version string `json:"VERSION"` Picture string `json:"ALB_PICTURE"` DigitalReleaseDate string `json:"DIGITAL_RELEASE_DATE"` PhysicalReleaseDate string `json:"PHYSICAL_RELEASE_DATE"` ProviderID string `json:"PROVIDER_ID"` SonyProdID string `json:"SONY_PROD_ID"` UPC string `json:"UPC"` Status string `json:"STATUS"` Fans int `json:"NB_FAN"` Available bool `json:"AVAILABLE"` ExplicitContent ExplicitContent `json:"EXPLICIT_ALBUM_CONTENT"` }
type ChunkDecrypter ¶
type ChunkDecrypter struct {
// contains filtered or unexported fields
}
func NewChunkDecrypter ¶
func NewChunkDecrypter(songid string) (*ChunkDecrypter, error)
func (ChunkDecrypter) DecryptChunk ¶
func (c ChunkDecrypter) DecryptChunk(dst, src []byte)
type Client ¶
func NewClient ¶
NewClient returns a Deezer client with the given arl (used for authentication) this arl can be gotten by following these instructions: https://notabug.org/RemixDevs/DeezloaderRemix/wiki/Login+via+userToken
func NewClientWithHTTPClient ¶
NewClientWithHTTPClient returns a Deezer client with the given arl. This is useful for setting a timeout for requests made by the Client. It will modify the given http.Client's Jar.
func (*Client) AlbumsByArtist ¶
AlbumsBy fetches albums in an artist's discography.
func (*Client) AvailableQualities ¶
AvailableQualities returns the available qualities for download of a song.
func (*Client) Download ¶
Download returns an io.ReadCloser from which the song can be read at the given quality. This function is deprecated and it is preferred to use song.Write
func (*Client) IsQualityAvailable ¶
IsQualityAvailable returns whether or not a song is available to download for a song.
func (*Client) Lyrics ¶ added in v1.2.0
Lyrics fetches a song's lyrics. The ID provided can be from a Song's LyricsID field.
type ContentType ¶
type ContentType string
const ( ContentAlbum ContentType = "album" ContentArtist ContentType = "artist" ContentSong ContentType = "track" )
func ParseURL ¶
func ParseURL(link string) (ctype ContentType, id string)
ParseURL returns the content type and id of a given Deezer URL.
type Contributors ¶
type DecryptingReader ¶
type DecryptingReader struct {
// contains filtered or unexported fields
}
func NewDecryptingReader ¶
func NewDecryptingReader(r io.Reader, songid string) (*DecryptingReader, error)
NewDecryptingReader creates an DecryptingReader that reads from r and decrypts it using s.
func (*DecryptingReader) Read ¶
func (r *DecryptingReader) Read(p []byte) (int, error)
Read reads up to n(p) bytes into p, returning how many bytes were read and any error.
func (*DecryptingReader) ReadChunk ¶
func (r *DecryptingReader) ReadChunk() ([]byte, error)
ReadChunk returns the next n<=2048 bytes of the song. It automatically decrypts chunks when it has to (every third chunk). You most likely would prefer to use Read instead of ReadChunk because it implements io.Reader.
type ErrUnexpectedStatusCode ¶
type ErrUnexpectedStatusCode struct{ Code int }
func (ErrUnexpectedStatusCode) Error ¶
func (err ErrUnexpectedStatusCode) Error() string
type ExplicitContent ¶
type Lyrics ¶ added in v1.2.0
type Lyrics struct { Text string `json:"LYRICS_TEXT"` ID string `json:"LYRICS_ID"` Copyrights string `json:"LYRICS_COPYRIGHTS"` Writers string `json:"LYRICS_WRITERS"` Sync []SyncedLyric `json:"LYRICS_SYNC_JSON"` }
type SearchResponse ¶
type Song ¶
type Song struct { Filesize string `json:"FILESIZE"` ProductTrackID string `json:"PRODUCT_TRACK_ID"` DigitalReleaseDate string `json:"DIGITAL_RELEASE_DATE"` Title string `json:"SNG_TITLE"` ArtistID string `json:"ART_ID"` ProviderID string `json:"PROVIDER_ID"` ArtistName string `json:"ART_NAME"` HierarchicalTitle string `json:"HIERARCHICAL_TITLE"` ISRC string `json:"ISRC"` AlbumID string `json:"ALB_ID"` AlbumTitle string `json:"ALB_TITLE"` MD5Origin string `json:"MD5_ORIGIN"` ExplicitLyrics string `json:"EXPLICIT_LYRICS"` Duration string `json:"DURATION"` AlbumPicture string `json:"ALB_PICTURE"` ArtistPicture string `json:"ART_PICTURE"` Rank string `json:"RANK_SNG"` Version string `json:"VERSION"` DiskNumber string `json:"DISK_NUMBER"` MediaVersion string `json:"MEDIA_VERSION"` ID string `json:"SNG_ID"` PhysicalReleaseDate string `json:"PHYSICAL_RELEASE_DATE"` Contributors Contributors `json:"SNG_CONTRIBUTORS"` Artists []Artist `json:"ARTISTS"` ExplicitContent ExplicitContent `json:"EXPLICIT_TRACK_CONTENT"` TrackNumber int `json:"TRACK_NUMBER,string"` FilesizeMP3128 int `json:"FILESIZE_MP3_128,string"` UploadID int `json:"UPLOAD_ID"` FilesizeFLAC int `json:"FILESIZE_FLAC,string"` FilesizeMP3320 int `json:"FILESIZE_MP3_320,string"` LyricsID int `json:"LYRICS_ID"` Status int `json:"STATUS"` Video bool `json:"VIDEO"` }
func (Song) DownloadURL ¶
DownloadURL returns a download URL which can be used to stream the song. The audio returned from the URL will be encrypted so you should use a DecryptingReader to read it.