Turn a suno playlist into a random music radio!
I'm very new about streaming media, so this tool maybe buggy, PR welcomes!
Basicly it's an ogg, so we can play it almost anywhere, browsers (not the iOS safari), players, or in the cli:
curl -s http://127.0.0.1:3000/v1/playlist/trending | \
ffplay -hide_banner -autoexit -nodisp -
curl -s http://127.0.0.1:3000/v1/playlist/trending | \
mpv -
- Get all playlists
curl http://127.0.0.1:3000/v1/playlist
- Add a new playlist (only if the
auth
is not empty in the server.yml)
You can get the playlist id from the URL, for example cc14084a-2622-4c4b-8258-1f6b4b4f54b3
in the https://app.suno.ai/playlist/cc14084a-2622-4c4b-8258-1f6b4b4f54b3/
Also, you'd like to create your own playlist on https://app.suno.ai/me/ and add clips into it.
# foo is the alias of the playlist, name it with a [0-9a-z_-]{3,32} string
curl -X PUT -H 'SUNO-RADIO-AUTH: VMkBqnjDUtQB65a9eDKSFhgAIhs8pPdri7rzrd7RO2w' \
http://127.0.0.1:3000/v1/playlist/cc14084a-2622-4c4b-8258-1f6b4b4f54b3/foo
Bravo! You've got your own music radio! It's hosted on http://127.0.0.1:3000/v1/playlist/cc14084a-2622-4c4b-8258-1f6b4b4f54b3
and http://127.0.0.1:3000/v1/playlist/foo
Delete the playlist by id:
curl -X DELETE -H 'SUNO-RADIO-AUTH: VMkBqnjDUtQB65a9eDKSFhgAIhs8pPdri7rzrd7RO2w' \
http://127.0.0.1:3000/v1/playlist/cc14084a-2622-4c4b-8258-1f6b4b4f54b3
This is an instance for myself, hosted on a very low-end VPS, so it's unstable:
# list available playlists
curl -s https://gas-observe-ky-mention.trycloudflare.com/v1/playlist | jq
# There're some alias same with the official playlists
curl -s https://gas-observe-ky-mention.trycloudflare.com/v1/playlist/trending | \
ffplay -hide_banner -autoexit -nodisp -
curl -s https://gas-observe-ky-mention.trycloudflare.com/v1/playlist/weekly | \
ffplay -hide_banner -autoexit -nodisp -
curl -s https://gas-observe-ky-mention.trycloudflare.com/v1/playlist/monthly | \
ffplay -hide_banner -autoexit -nodisp -
curl -s https://gas-observe-ky-mention.trycloudflare.com/v1/playlist/top | \
ffplay -hide_banner -autoexit -nodisp -
- Requirements:
- Go 1.22+
- ffmpeg for converting mp3 to ogg
git clone --depth=1 https://github.com/hellodword/suno-radio
cd suno-radio
./scripts/build.sh