diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-08-21 08:07:26 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-08-21 08:28:36 +0700 |
commit | 5b1d85754ee2f1a8b94c979bc5122b4130ef8cc7 (patch) | |
tree | b8eab2ccf2f0f05bf079635cf07c89afabd34f90 | |
parent | e25586e47163c83e519ae0af9aa6d8fbc3d58ef4 (diff) |
[YoutubeDL] Autocalculate ext when ext is None
-rwxr-xr-x | youtube_dl/YoutubeDL.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index e844dc98a..0b3e3da82 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1299,7 +1299,7 @@ class YoutubeDL(object): for subtitle_format in subtitle: if subtitle_format.get('url'): subtitle_format['url'] = sanitize_url(subtitle_format['url']) - if 'ext' not in subtitle_format: + if subtitle_format.get('ext') is None: subtitle_format['ext'] = determine_ext(subtitle_format['url']).lower() if self.params.get('listsubtitles', False): @@ -1354,7 +1354,7 @@ class YoutubeDL(object): note=' ({0})'.format(format['format_note']) if format.get('format_note') is not None else '', ) # Automatically determine file extension if missing - if 'ext' not in format: + if format.get('ext') is None: format['ext'] = determine_ext(format['url']).lower() # Automatically determine protocol if missing (useful for format # selection purposes) |