From 64ad2fc28ffc8f50684582e4ab146599a00721a5 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Tue, 8 Oct 2024 21:47:00 -0300 Subject: [PATCH] Use mvi and mn query params to build host url --- main.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index 35e86ce..815c5d0 100644 --- a/main.go +++ b/main.go @@ -99,22 +99,25 @@ func (*requesthandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { } q := req.URL.Query() - host := q.Get("host") - q.Del("host") - if len(host) <= 0 { - host = q.Get("hls_chunk_host") - } + // https://rr(mvi)---(mn).googlevideo.com - if len(host) <= 0 { - host = getHost(req.URL.EscapedPath()) - } + mvi := q.Get("mvi") + mn := strings.Split(q.Get("mn"), ",") - if len(host) <= 0 { - io.WriteString(w, "No host in query parameters.") + if len(mvi) <= 0 { + io.WriteString(w, "No `mvi` in query parameters") 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), ".") if len(parts) < 2 {