[generic] Support application/ogg for direct links
authorPhilipp Hagemeister <phihag@phihag.de>
Tue, 17 Dec 2013 15:26:32 +0000 (16:26 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Tue, 17 Dec 2013 15:26:34 +0000 (16:26 +0100)
Also remove some debugging code.

youtube_dl/extractor/generic.py

index 209f68204ef7fd342edf8200e148f249a5d99266..fd32370c2db0c4e3e6c7c6a4039a656e846c64c9 100644 (file)
@@ -164,18 +164,18 @@ class GenericIE(InfoExtractor):
 
             # Check for direct link to a video
             content_type = response.headers.get('Content-Type', '')
-            m = re.match(r'^(?:audio|video)/(?P<format_id>.+)$', content_type)
+            m = re.match(r'^(?P<type>audio|video|application(?=/ogg$))/(?P<format_id>.+)$', content_type)
             if m:
                 upload_date = response.headers.get('Last-Modified')
                 if upload_date:
                     upload_date = unified_strdate(upload_date)
-                assert (url_basename(url) == 'trailer.mp4')
                 return {
                     'id': video_id,
                     'title': os.path.splitext(url_basename(url))[0],
                     'formats': [{
                         'format_id': m.group('format_id'),
                         'url': url,
+                        'vcodec': u'none' if m.group('type') == 'audio' else None
                     }],
                     'upload_date': upload_date,
                 }