Fix HD720 and audio only playbacks (Hopefully this will fix it right?)
All checks were successful
CI / build (push) Successful in 3m52s
All checks were successful
CI / build (push) Successful in 3m52s
This commit is contained in:
parent
fa0c7e9373
commit
78ae56be37
1 changed files with 2 additions and 1 deletions
|
@ -77,7 +77,6 @@ func videoplayback(w http.ResponseWriter, req *http.Request) {
|
|||
log.Panic(err)
|
||||
}
|
||||
|
||||
w.WriteHeader(resp.StatusCode)
|
||||
if resp.StatusCode == 403 {
|
||||
atomic.AddInt64(&stats_.RequestsForbidden.Videoplayback, 1)
|
||||
io.WriteString(w, "Forbidden 403\n")
|
||||
|
@ -90,6 +89,8 @@ func videoplayback(w http.ResponseWriter, req *http.Request) {
|
|||
NoRewrite := strings.HasPrefix(resp.Header.Get("Content-Type"), "audio") || strings.HasPrefix(resp.Header.Get("Content-Type"), "video")
|
||||
copyHeaders(resp.Header, w.Header(), NoRewrite)
|
||||
|
||||
w.WriteHeader(resp.StatusCode)
|
||||
|
||||
if req.Method == "GET" && (resp.Header.Get("Content-Type") == "application/x-mpegurl" || resp.Header.Get("Content-Type") == "application/vnd.apple.mpegurl") {
|
||||
bytes, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue