From: Yen Chi Hsuan Date: Sun, 15 May 2016 07:32:54 +0000 (+0800) Subject: [utils] Fix getheader in urlhandle_detect_ext X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;ds=sidebyside;h=79298173c5a957456cb17b2b26338a657f1aae1e;p=youtube-dl [utils] Fix getheader in urlhandle_detect_ext Fixes #7049, related to #9440 --- 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: