OliveTV is a CLI utility which gets stream url along with other streamer details.
-
build from source
go install github.com/go-olive/tv/cmd/olivetv@latest
-
download from releases
After installing, simply use:
olivetv -u https://www.huya.com/518512
or
olivetv -sid huya -rid 518512
Some platforms might need a cookie, use -c to set one.
eg.
olivetv -u https://live.douyin.com/xxx -c cookie
site | cookie example |
---|---|
douyin | "__ac_nonce=06245c89100e7ab2dd536; __ac_signature=_02B4Z6wo00f01LjBMSAAAIDBwA.aJ.c4z1C44TWAAEx696;" |
kuaishou | "did=web_d079abeeeba77349c6eb5724363b8958" |
This API is what powers the cli but is also available to developers that wish to make use of the data OliveTV can retrieve in their own application.
package main
import (
"github.com/go-olive/tv"
)
func main() {
t, err := tv.New("huya", "518512")
if err != nil {
return
}
if err := t.Snap(); err != nil {
return
}
if url, liveOn := t.StreamUrl(); liveOn {
println("stream url: ", url)
}
}
All contributions are welcome. Feel free to open a new thread on the issue tracker or submit a new pull request.
For developer, check out template file if you want to add a new site.
This project is inspired by real-url and streamlink.