From c1002e96e98f4851aed5de0142e8e2bd1ac4661c Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Mon, 28 Oct 2013 11:28:02 +0100 Subject: [PATCH] Let extractors omit ext in formats --- youtube_dl/YoutubeDL.py | 3 +++ youtube_dl/extractor/addanime.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index d4654cc05..b09eeff32 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -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) diff --git a/youtube_dl/extractor/addanime.py b/youtube_dl/extractor/addanime.py index 3b8258ad8..b99d4b966 100644 --- a/youtube_dl/extractor/addanime.py +++ b/youtube_dl/extractor/addanime.py @@ -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!') -- 2.22.2