Reverse Engineering Samsung Music to play YouTube Music

Posted on Apr 03, 2026 | Read time: 16 hours | 10

Day 1 (02 April 2026)

I've just grab several Melon APIs and re-make with python flask server, and redirect from Melon server to localhost.

And it seems work just fine, so i only need to implement youtube api in flask server, so i'm used ytmusic and yt-dlp library.

And yes, everything seems work. Or maybe required some adjust like re-writing youtube api to be-like melon api.

It seems the player want play from “mcache” protocol, i've implemented http/https protocol into app. And it's completely working!

However, new issue is player took so long for fetching raw music and very very slow download, it only want stream after so much bytes. Maybe i'll re-make proxy protocol tomorrow.

 

Day 2 (03 April 2026)

So, i made proxy source code and merge it, and it seems the issue still persist.

Maybe if i should re-make “mcache” protocol logic instead?

Read file directly with proxy breaks the seek function. Probably the issue is app itself, it was so slow when downloading music.

I think i found the main issue, smusic did not send header of range, and server response 200. Which app will download full size instead of 206 partial content.

When i tried request get the content with “Range: bytes=0-0” it returned Content-Length, which is full size of bytes audio content.

Perfect! Now let's update my proxy code and use this flow:

1. Range 0-0 → get size
2. Client request range
3. Proxy forward range
4. Upstream reply 206
5. Proxy forward response

Alright, seems so very perfect! I've updated my proxy code and it's streaming so good with full speed now!

Now i'm facing a bug the player re-stream same audio from network when repeat the audio. Maybe i should implement songId to my proxy code, but i have to grab and implement the args somewhere in smali codes.

apps
youtube
reverse engineering