From 188e007dfd2141c9669a1dc615b7d0cab56d0b80 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Wed, 30 Oct 2024 03:08:24 -0300 Subject: [PATCH] Add headers to look like a browser --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index 687105e..ec5c0cd 100644 --- a/main.go +++ b/main.go @@ -174,6 +174,15 @@ func beforeAll(next http.HandlerFunc) http.HandlerFunc { atomic.AddInt64(&stats_.RequestCount, 1) + // Too 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", "*") w.Header().Set("Access-Control-Max-Age", "1728000")