Riva Server is a Go HTTP service that provides media metadata and stream proxy endpoints for YouTube and SoundCloud.
- YouTube metadata endpoint
- YouTube streaming proxy endpoint
- SoundCloud streaming proxy endpoint
- Optional shared-token access protection for provider routes
- Configurable cache duration, concurrency, and log level
- Go 1.26+
- Clone the repository.
- Copy
.env.exampleto.envand adjust values as needed. - Run:
go run ./cmdThe server listens on RIVA_PORT (default 8080).
Environment variables:
RIVA_PORT(default:8080)RIVA_LOG_LEVEL(default:info)RIVA_CLIENT_TYPE(default:ANDROID; allowed:WEB,ANDROID,IOS)RIVA_CACHE_DURATION(default:5m)RIVA_MAX_CONCURRENT(default:32)RIVA_ACCESS_SECRET(optional; enables auth if set)
Auth behavior for /providers/* routes when RIVA_ACCESS_SECRET is set:
Authorization: Bearer <secret>X-API-Key: <secret>(alsoX-Riva-Key,X-Riva-Token)- Query string keys:
api_key,apikey,token,secret(NOTE: query param auth is less secure and generally not recommended)
Public:
GET /health
Protected (if RIVA_ACCESS_SECRET is configured):
GET /providers/youtube/{id}/infoGET /providers/youtube/{id}/stream/{itag}GET /providers/soundcloud/stream?url=<track_url>
Run tests:
go test ./...Build locally:
go build -o riva-server ./cmdSee docs/README.md for minimal server docs.
Please read CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.
Licensed under the terms in LICENSE.