Introduction
One sleepless night, my friend and I talked about Spotify codes.
These are pictures that can be scanned by the application and go to the desired track / album / playlist. They were invented so that people could share music on social networks or offline.
We decided to figure out how Spotify encodes links in them.
How do codes work?
, «» , Spotify Codes, .
, - : https://scannables.scdn.co/uri/plain/jpeg/000000/white/640/spotify:track:5jxN9knH0vlfpN2Ft7a5xi
! , ID — .
, SVG. , .
, , , , Spotify, . .
556205622371746371156, 58992959842 . . ? Spotify, .
: 58992959842 spotify:track:5jxN9knH0vlfpN2Ft7a5xi?
, - ID, ID - .
. , / .
:
: . ?
, ? ?
, , 11- ID.
, ?
. , . , , :
. Spotify , , , , .
- - , : .
, , ID .
Android-, , , ID . , urlencode. , spotify:track:2ctvdKmETyOzPb2GiJJT53%253Fhi,habr!, :
, , . Base64, URL .
Spotify ? , , . , .
Spotify? , , . .
? , . , , , . , API , , Spotify-, .
UPD: 15 , , Spotify .
The code generator no longer accepts garbage, now only IDs that match the format work.
This is very disappointing because I thought they didn't care and they would consider it a feature. Could go to Bug Bounty :(