Skip to content

Commit

Permalink
Ensure urllib3 and python version not leaked during video file check
Browse files Browse the repository at this point in the history
This is likely not a big deal since it is already assumed that video file server logs are not plugged into
Google's tracking infrastructure, but it doesn't hurt to give less info.
  • Loading branch information
user234683 committed Feb 19, 2020
1 parent 3beb280 commit 0989d55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion youtube/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0989d55

Please sign in to comment.