diff options
-rw-r--r-- | youtube/util.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube/util.py b/youtube/util.py index c7168a8..a70bd7e 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -206,7 +206,8 @@ def head(url, use_tor=False, report_text=None, max_redirects=10): # to 10 since googlevideo redirects a lot. retries = urllib3.Retry(3+max_redirects, redirect=max_redirects, raise_on_redirect=False) - response = pool.request('HEAD', url, retries=retries) + headers = {'User-Agent': 'Python-urllib'} + response = pool.request('HEAD', url, headers=headers, retries=retries) if report_text: print(report_text, ' Latency:', round(time.time() - start_time,3)) return response |