mirror of
https://github.com/nxshock/promodj.git
synced 2025-07-05 00:23:11 +05:00
Add custom bitrate parser
This commit is contained in:
parent
87bc382747
commit
e8abe97992
3 changed files with 11 additions and 5 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func handleGenres(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -90,7 +91,12 @@ func handleGetM3u(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
func handleStream(w http.ResponseWriter, r *http.Request) {
|
||||
err := stream(r.FormValue("url"), w)
|
||||
bitrateKbps, err := strconv.ParseUint(r.FormValue("b"), 10, 64)
|
||||
if err != nil {
|
||||
bitrateKbps = config.Bitrate
|
||||
}
|
||||
|
||||
err = stream(r.FormValue("url"), w, bitrateKbps)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue