fixup! Use mvi and mn query params to build host url
All checks were successful
CI / build (push) Successful in 2m6s
All checks were successful
CI / build (push) Successful in 2m6s
This commit is contained in:
parent
64ad2fc28f
commit
6f5f04c618
1 changed files with 23 additions and 12 deletions
35
main.go
35
main.go
|
@ -99,23 +99,34 @@ func (*requesthandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
q := req.URL.Query()
|
q := req.URL.Query()
|
||||||
|
host := q.Get("host")
|
||||||
|
|
||||||
|
if len(host) <= 0 {
|
||||||
|
host = q.Get("hls_chunk_host")
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(host) <= 0 {
|
||||||
|
host = getHost(req.URL.EscapedPath())
|
||||||
|
}
|
||||||
|
|
||||||
// https://rr(mvi)---(mn).googlevideo.com
|
// https://rr(mvi)---(mn).googlevideo.com
|
||||||
|
if len(host) <= 0 {
|
||||||
|
mvi := q.Get("mvi")
|
||||||
|
mn := strings.Split(q.Get("mn"), ",")
|
||||||
|
if len(mvi) <= 0 {
|
||||||
|
io.WriteString(w, "No `mvi` in query parameters")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
mvi := q.Get("mvi")
|
if len(mn) <= 0 {
|
||||||
mn := strings.Split(q.Get("mn"), ",")
|
io.WriteString(w, "No `mn` in query parameters")
|
||||||
|
return
|
||||||
if len(mvi) <= 0 {
|
}
|
||||||
io.WriteString(w, "No `mvi` in query parameters")
|
host = "rr" + mvi + "---" + mn[0] + ".googlevideo.com"
|
||||||
return
|
} else {
|
||||||
|
io.WriteString(w, "Not possible to build host url from `mvi` and `mn`.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(mn) <= 0 {
|
|
||||||
io.WriteString(w, "No `mn` in query parameters")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
host := "rr" + mvi + "---" + mn[0] + ".googlevideo.com"
|
|
||||||
q.Del("host")
|
q.Del("host")
|
||||||
|
|
||||||
parts := strings.Split(strings.ToLower(host), ".")
|
parts := strings.Split(strings.ToLower(host), ".")
|
||||||
|
|
Loading…
Add table
Reference in a new issue