Optionalclient: ClientThe owning client, stored for later convenience calls.
OptionalbitrateBitrate in kbit/s.
OptionalclientThe client that created this model, used by convenience methods.
OptionalcodecActual codec served (flac, flac-mp4, aac, mp3, …).
OptionalgainWhether loudness-normalization gain data is available.
OptionalkeyHex AES-CTR key used to decrypt an encraw stream, when encrypted.
OptionalqualityRequested/granted quality (for example lossless).
OptionalrealCanonical track id when the requested id is an alias.
OptionalsizeFile size in bytes, when known.
OptionaltrackTrack id this info belongs to.
OptionaltransportTransport, typically encraw (AES-CTR-encrypted raw stream).
OptionalurlSingle stream URL (older response shape).
OptionalurlsCandidate stream URLs (any one works).
Whether this is a true lossless (FLAC) variant.
StaticdeDownload the audio straight to a file on disk, streaming it and transparently
AES-CTR-decrypting an encraw stream on the fly when key is present.
Streaming keeps memory O(chunk) rather than buffering the whole (large, for lossless) file. Mirror URLs are tried in order, so a flaky host falls back to the next.
Destination path, including extension.
Set race: true to race all mirror URLs and commit to the
fastest responder (cuts tail latency when a host is slow; falls back to
sequential on failure). Defaults to sequential mirror failover.
Download the audio as bytes, transparently AES-CTR-decrypting an encraw
stream when key is present.
/get-file-info returns several mirror URLs on different CDN hosts; this
tries each in order so a single flaky host doesn't fail the download.
The decoded audio file contents.
Pick a stream URL.
The first candidate stream URL (the bytes may be encrypted — see key).
Every candidate stream URL, in preference order (urls then url).
Protectedrequire
Lossless (and other modern) download info from
/get-file-info.Remarks
With
transport: 'encraw'the URLs serve an AES-CTR-encrypted stream and LosslessDownloadInfo.key holds the hex decryption key; LosslessDownloadInfo.downloadBytes fetches and decrypts it for you. The endpoint falls back to a lossy codec when a track has no lossless source, so check LosslessDownloadInfo.codec / LosslessDownloadInfo.isLossless.