[YoutubeDL] Force string conversion on non string video ids
authorSergey M․ <dstftw@gmail.com>
Wed, 8 Jun 2016 22:34:19 +0000 (05:34 +0700)
committerSergey M․ <dstftw@gmail.com>
Wed, 8 Jun 2016 22:34:19 +0000 (05:34 +0700)
youtube_dl/YoutubeDL.py

index 3917ca9dcd7e9ac430241e887fe7bb813e1a8ba6..5036289b062f9ee05ab5c872c76ab38babcb4a54 100755 (executable)
@@ -1223,6 +1223,10 @@ class YoutubeDL(object):
         if 'title' not in info_dict:
             raise ExtractorError('Missing "title" field in extractor result')
 
+        if not isinstance(info_dict['id'], compat_str):
+            self.report_warning('"id" field is not a string - forcing string conversion')
+            info_dict['id'] = compat_str(info_dict['id'])
+
         if 'playlist' not in info_dict:
             # It isn't part of a playlist
             info_dict['playlist'] = None