Let extractors omit ext in formats
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 28 Oct 2013 10:28:02 +0000 (11:28 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 28 Oct 2013 10:28:02 +0000 (11:28 +0100)
youtube_dl/YoutubeDL.py
youtube_dl/extractor/addanime.py

index d4654cc05a5f6dae132d818fd33067cbbc98b49f..b09eeff32d0c03cd849dc28a168cf9fcf3352d59 100644 (file)
@@ -484,6 +484,9 @@ class YoutubeDL(object):
                     res=self.format_resolution(format),
                     note=u' ({})'.format(format['format_note']) if format.get('format_note') is not None else '',
                 )
+            # Automatically determine file extension if missing
+            if 'ext' not in format:
+                format['ext'] = determine_ext(format['url'])
 
         if self.params.get('listformats', None):
             self.list_formats(info_dict)
index 3b8258ad8654774def4f95aa2e121883be9c8638..b99d4b96689c23a13379d4392484c3763ce0e36f 100644 (file)
@@ -71,7 +71,6 @@ class AddAnimeIE(InfoExtractor):
             formats.append({
                 'format_id': format_id,
                 'url': video_url,
-                'ext': video_url[-3:],
             })
         if not formats:
             raise ExtractorError(u'Cannot find any video format!')