fixup! Add headers to look like a browser
All checks were successful
CI / build (push) Successful in 4m53s

This commit is contained in:
Fijxu 2024-10-31 16:11:39 -03:00
parent 188e007dfd
commit 81bf2f1568
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4
2 changed files with 1 additions and 7 deletions

View file

@ -67,7 +67,6 @@ func videoplayback(w http.ResponseWriter, req *http.Request) {
request, err := http.NewRequest("POST", proxyURL.String(), bytes.NewReader(body))
copyHeaders(req.Header, request.Header, false)
request.Header.Set("User-Agent", ua)
if err != nil {
log.Panic(err)

View file

@ -174,14 +174,9 @@ func beforeAll(next http.HandlerFunc) http.HandlerFunc {
atomic.AddInt64(&stats_.RequestCount, 1)
// Too look like more like a browser
// To look like more like a browser
req.Header.Add("Origin", "https://www.youtube.com")
req.Header.Add("Pargma", "no-cache")
req.Header.Add("Priority", "u=1, i")
req.Header.Add("Referer", "https://www.youtube.com/")
req.Header.Add("sec-fetch-dest", "empty")
req.Header.Add("sec-fetch-mode", "cors")
req.Header.Add("sec-fetch-site", "cross-site")
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Headers", "*")