Posted on Apr 03, 2026 | Read time: 1 days | 1173
Hello, currently i'm working on Samsung Music that has public online stream.Instead of using spotify api, i'm using youtube music because it's free. Who don't like free?
So i'll write all my progress here, because someday i'll read this again in the future. Or maybe someone doing same stuff i do you can learn it in here as well.
No, this is not april fools or something. This is non-big project i'm working on my spare time.
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.
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:
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.
I do clean up my code to be more modular and readable, home page was not clean enough because melon api was static, while youtube has dynamic home. I have to think how to convert these beautifully.
For now i made a progress by making own playlist show up and it's played fine. Look good to me ngl
Just overhauled my proxy stream server code, and patch smali to sending song id key. It took a while but worth of my time.
Now player stream with cache smoothly. And repeat or next music play does so nicely.
Not only that, i store stream url with expire 1 hour to make sure server quickly return stream url when re-playing same music.
I think player spam song detail api when play from playlist, now i've added sql cache to song detail too, with 1 hr expired as well.
Made in-app google auth and multiple account support. No gms needed.
Functional is 100% working but need some tweak on layout.
Maybe i'll re-write the code later if i got more time
Successfully ported top 10 global music
I'm going to hold the project about one or two weeks
Hello, Anonymous! Want log in?