]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[YoutubeDL] Make sure format id is not empty
authorSergey M․ <dstftw@gmail.com>
Sat, 12 Aug 2017 10:14:11 +0000 (17:14 +0700)
committerSergey M․ <dstftw@gmail.com>
Sat, 12 Aug 2017 10:14:11 +0000 (17:14 +0700)
youtube_dl/YoutubeDL.py

index 367ae3533054bc360a82443ea59dc8bd9f9764c4..df7378f8348a2b8ba671d9998395782168322c23 100755 (executable)
@@ -1500,7 +1500,7 @@ class YoutubeDL(object):
             sanitize_string_field(format, 'format_id')
             sanitize_numeric_fields(format)
             format['url'] = sanitize_url(format['url'])
-            if format.get('format_id') is None:
+            if not format.get('format_id'):
                 format['format_id'] = compat_str(i)
             else:
                 # Sanitize format_id from characters used in format selector expression