suno-radio

module
v0.0.0-...-4445da1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2024 License: MIT

README

suno-radio

Matrix Space

Turn a suno playlist into a random music radio!

I'm very new about streaming media, so this tool maybe buggy, PR welcomes!

Usage

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

Online demo

This is an instance for myself, hosted on a very low-end VPS, so it's unstable:

Online demo: https://folks-norwegian-disaster-quebec.trycloudflare.com

Build

git clone --depth=1 https://github.com/hellodword/suno-radio
cd suno-radio

cp server.yml.template server.yml
vim server.yml

mkdir -p data
sudo chown -R 65532:65532 data

docker compose up --build --pull always -d

# docker compose logs -f

TODO

https://github.com/search?q=repo%3Ahellodword%2Fsuno-radio%20%2F(%3F-i)%5C%2F%5C%2F%20TODO%2F%20NOT%20path%3A3rd&type=code

Thanks

Directories

Path Synopsis
cmd
internal
httperr
https://github.com/jonnylangefeld/go-api/blob/c43e67c7d2d8626f1eaf724bf471272ee25b6dff/pkg/types/types.go
https://github.com/jonnylangefeld/go-api/blob/c43e67c7d2d8626f1eaf724bf471272ee25b6dff/pkg/types/types.go
ogg
Package ogg implements encoding and decoding of OGG streams as defined in http://xiph.org/ogg/doc/rfc3533.txt and http://xiph.org/ogg/doc/framing.html .
Package ogg implements encoding and decoding of OGG streams as defined in http://xiph.org/ogg/doc/rfc3533.txt and http://xiph.org/ogg/doc/framing.html .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL