aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/__init__.py
diff options
context:
space:
mode:
authorPierre Rudloff <contact@rudloff.pro>2013-08-28 11:02:12 +0200
committerPierre Rudloff <contact@rudloff.pro>2013-08-28 11:02:12 +0200
commit1301a0dd426a88ed39d38ac6ad04e9000c7811a4 (patch)
tree9c6dc83aa9e3a4f03d2b4ac183ec8aeda945a14b /youtube_dl/__init__.py
parentc5b921b5975f84ec31077cf5333f14736efe40b6 (diff)
parentaf8bd6a82d140e5a776185707a9b21d5b8a9fe52 (diff)
downloadhypervideo-pre-1301a0dd426a88ed39d38ac6ad04e9000c7811a4.tar.lz
hypervideo-pre-1301a0dd426a88ed39d38ac6ad04e9000c7811a4.tar.xz
hypervideo-pre-1301a0dd426a88ed39d38ac6ad04e9000c7811a4.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r--youtube_dl/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index 614429073..bc6a6d180 100644
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -430,6 +430,10 @@ def _real_main(argv=None):
proxy_handler = compat_urllib_request.ProxyHandler(proxies)
https_handler = make_HTTPS_handler(opts)
opener = compat_urllib_request.build_opener(https_handler, proxy_handler, cookie_processor, YoutubeDLHandler())
+ # Delete the default user-agent header, which would otherwise apply in
+ # cases where our custom HTTP handler doesn't come into play
+ # (See https://github.com/rg3/youtube-dl/issues/1309 for details)
+ opener.addheaders =[]
compat_urllib_request.install_opener(opener)
socket.setdefaulttimeout(300) # 5 minutes should be enough (famous last words)