From b55ee18ff3a9642fe25a977e1152472877294493 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Thu, 22 Jan 2015 12:04:07 +0100 Subject: [hearthisat] Add support for more high-quality download links --- youtube_dl/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'youtube_dl/utils.py') diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 7832ed87f..764474c33 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1612,6 +1612,14 @@ def urlhandle_detect_ext(url_handle): except AttributeError: # Python < 3 getheader = url_handle.info().getheader + cd = getheader('Content-Disposition') + if cd: + m = re.match(r'attachment;\s*filename="(?P[^"]+)"', cd) + if m: + e = determine_ext(m.group('filename'), default_ext=None) + if e: + return e + return getheader('Content-Type').split("/")[1] -- cgit v1.2.3