Skip to content
Rémy F edited this page Mar 12, 2021 · 12 revisions

DZR Environment Variables

In order to play a track, dzr will:

  • Fetch track information using at least one of following methods:

    • DZR_API: undocumented mobile API (recommended)
    • DZR_SID: Your private user Session ID
    • DZR_LUT: External resolver command
  • Find the track URL using the mandatory DZR_AES key

  • Decrypt the track using the mandatory DZR_CBC key

Diagram Version

Keys (All mandatory)

DZR_AES

Used for URL Generation

[...key].map(e=>String.fromCharCode(e)).join('')

DZR_CBC

Used for track deciphering

Same method as the DZR_AES, but the CBC keys are split in 2 arrays that need to be reassembled using the following script

a=[97, ... 103]
b=[49, ... 52]
[].concat(...a.map((c,i)=>[a[i],b[i]]).reverse()).map(e=>String.fromCharCode(e)).join('')

Methods (at least one must be defined)

DZR_API

✔️ Recommended

  • download the latest deezer.android.app
  • grep the key: zipgrep -hoa '[0-9A-Z]{64}' deezer.*.apk classes.dex | grep -Pv '[0-9]{63}' | grep -Pv '[A-Z]{64}'
  • if you don't have zipgrep (windows without WSL) : see instructions here.

DZR_SID

⚠️ This key is temporary and will expire, so update it periodically.

To get your Session ID, look at the network request panel of your browser debugger and you shall see a Set-Cookie line with sid=yoursidnumber

DZR_LUT

Specify the command that'll retrieve the track MD5:id tuple.

RickRoll Resolver Example The following script will resolve every track to the popular Rick Ashley song, for educational purpose.
# save + chmod this line as "rickroll.sh" script:
>&2 echo resolving track $1 ...
echo 5e45db8562beee18000ba19b2480a6db:997764

Now try

# 42 or whatever track ID you want to be rick-rolled over
DZR_LUT="/path/to/your/rickroll.sh %s" dzr 42 | mpv -
Clone this wiki locally