aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-05-15 15:32:54 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-05-15 15:34:50 +0800
commit79298173c5a957456cb17b2b26338a657f1aae1e (patch)
tree0e0c5154c139277c9aab1b0225ac677c839db731 /youtube_dl/utils.py
parent69c9cc2716a4d076b023096c23b6f7646627824a (diff)
[utils] Fix getheader in urlhandle_detect_ext
Fixes #7049, related to #9440
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index a637563cb..24e74428b 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -2031,11 +2031,7 @@ def mimetype2ext(mt):
def urlhandle_detect_ext(url_handle):
- try:
- url_handle.headers
- getheader = lambda h: url_handle.headers[h]
- except AttributeError: # Python < 3
- getheader = url_handle.info().getheader
+ getheader = url_handle.headers.get
cd = getheader('Content-Disposition')
if cd: