Documentation ¶
Index ¶
- Constants
- Variables
- func DecryptSongFile(key []byte, inputPath, outputPath string) error
- func DumpResponse(resp *http.Response, message string)
- func ECB(key, data []byte) ([]byte, error)
- func MD5Hash(data []byte) string
- func MakeURLPath(track *Track, format Format) (string, error)
- type API
- type Format
- type Track
Constants ¶
View Source
const ( FLAC Format = 9 MP3_320 = 3 MP3_256 = 5 )
Variables ¶
View Source
var NoMD5Error = errors.New("no MD5 hash -- try authenticating")
Functions ¶
func DecryptSongFile ¶
DecryptSongFile decrypts the encrypted chunks of a song downloaded from deezer
func DumpResponse ¶
DumpResponse dumps a response with logrus
func ECB ¶
ECB implementation since golang technically doesn't support it based on https://stackoverflow.com/questions/24072026/golang-aes-ecb-encryption input data is automatically zero-padded
Types ¶
type API ¶
func (*API) ApiRequest ¶
ApiRequest performs an API request
func (*API) CookieLogin ¶
CookieLogin allows the user to log in using their arl cookie taken from a browser
func (*API) GetSongData ¶
GetSongData gets a track
type Track ¶
type Track struct { ID int `json:"SNG_ID,string"` Title string `json:"SNG_TITLE"` TrackNumber int `json:"TRACK_NUMBER,string"` Gain float32 `json:"GAIN,string"` MD5 string `json:"MD5_ORIGIN"` MediaVersion int `json:"MEDIA_VERSION,string"` // contains filtered or unexported fields }
func (*Track) GetBlowfishKey ¶
getBlowfishKey calculates the key required to decrypt the blowfish-encrypted file
func (*Track) GetDownloadURL ¶
GetDownloadURL gets the download url (as a *url.URL) for a given format
Click to show internal directories.
Click to hide internal directories.