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