mirror of
https://github.com/TeamPiped/http3-ytproxy.git
synced 2024-08-14 23:56:43 +00:00
revert query set, remove debug
This commit is contained in:
parent
5e969d3052
commit
01ac42bc11
1 changed files with 2 additions and 11 deletions
11
main.go
11
main.go
|
@ -127,23 +127,15 @@ func (*requesthandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyURL.RawQuery = ""
|
proxyURL.RawQuery = q.Encode()
|
||||||
for k, v := range q {
|
|
||||||
for _, vv := range v {
|
|
||||||
proxyURL.Query().Set(k, vv)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if strings.HasSuffix(proxyURL.EscapedPath(), "maxres.jpg") {
|
if strings.HasSuffix(proxyURL.EscapedPath(), "maxres.jpg") {
|
||||||
proxyURL.Path = getBestThumbnail(proxyURL.EscapedPath())
|
proxyURL.Path = getBestThumbnail(proxyURL.EscapedPath())
|
||||||
}
|
}
|
||||||
|
|
||||||
request, err := http.NewRequest(req.Method, proxyURL.String(), nil)
|
request, err := http.NewRequest(req.Method, proxyURL.String(), nil)
|
||||||
fmt.Println(proxyURL.Query().Encode())
|
|
||||||
fmt.Println(proxyURL.String())
|
|
||||||
copyHeaders(req.Header, request.Header)
|
copyHeaders(req.Header, request.Header)
|
||||||
request.Header.Set("User-Agent", ua)
|
request.Header.Set("User-Agent", ua)
|
||||||
fmt.Printf("User-Agent: %s\n", ua)
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
|
@ -205,7 +197,6 @@ func copyHeaders(from http.Header, to http.Header) {
|
||||||
// Loop over all values for the name.
|
// Loop over all values for the name.
|
||||||
for _, value := range values {
|
for _, value := range values {
|
||||||
to.Set(name, value)
|
to.Set(name, value)
|
||||||
fmt.Printf("%s: %s\n", name, value)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue