You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

transport.go 463B

1234567891011121314151617
  1. package net
  2. import "net/http"
  3. // Custom headers
  4. type transport struct{}
  5. // Important:
  6. // - Set header "Accept-Language: en-US" or else parser might break
  7. // - Set header "User-Agent: youtube-mango/1.0"
  8. func (t transport) RoundTrip(r *http.Request) (*http.Response, error) {
  9. r.Header.Add("Accept-Language", "en-US")
  10. r.Header.Add("User-Agent", "youtube-mango/0.1")
  11. return http.DefaultTransport.RoundTrip(r)
  12. }
  13. var Client = http.Client{Transport: transport{}}