fixup! Add headers to look like a browser
All checks were successful
CI / build (push) Successful in 4m53s
All checks were successful
CI / build (push) Successful in 4m53s
This commit is contained in:
parent
188e007dfd
commit
81bf2f1568
2 changed files with 1 additions and 7 deletions
|
@ -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)
|
||||
|
|
7
main.go
7
main.go
|
@ -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", "*")
|
||||
|
|
Loading…
Add table
Reference in a new issue