[extractor/generic] Force Content-Type to lowecase
[youtube-dl] / youtube_dl / extractor / generic.py
index 8121f04a5e02cf672dc6ab0f152d21df8b98034e..cce7799e2078e0c8ddb80cbd282a39f7a1bf45e8 100644 (file)
@@ -1248,8 +1248,8 @@ class GenericIE(InfoExtractor):
         }
 
         # Check for direct link to a video
-        content_type = head_response.headers.get('Content-Type', '')
-        m = re.match(r'^(?P<type>audio|video|application(?=/(?:ogg$|(?:vnd\.apple\.|x-)?mpegurl)))/(?P<format_id>.+)$', content_type)
+        content_type = head_response.headers.get('Content-Type', '').lower()
+        m = re.match(r'^(?P<type>audio|video|application(?=/(?:ogg$|(?:vnd\.apple\.|x-)?mpegurl)))/(?P<format_id>[^;\s]+)', content_type)
         if m:
             upload_date = unified_strdate(
                 head_response.headers.get('Last-Modified'))