Check if description and thumbnail are None to prevent crash
authorrzhxeo <rzhxeot7z81b4700@mailcatch.com>
Mon, 28 Oct 2013 15:28:35 +0000 (16:28 +0100)
committerrzhxeo <rzhxeot7z81b4700@mailcatch.com>
Mon, 28 Oct 2013 15:28:35 +0000 (16:28 +0100)
youtube_dl/YoutubeDL.py

index 19dabef2d012a9e9f678cc2bf1a649ab8714ec11..3132958397847a72d569f19b0b3887dfa3a540cd 100644 (file)
@@ -575,9 +575,9 @@ class YoutubeDL(object):
         if self.params.get('forceurl', False):
             # For RTMP URLs, also include the playpath
             compat_print(info_dict['url'] + info_dict.get('play_path', u''))
-        if self.params.get('forcethumbnail', False) and 'thumbnail' in info_dict:
+        if self.params.get('forcethumbnail', False) and info_dict.get('thumbnail') is not None:
             compat_print(info_dict['thumbnail'])
-        if self.params.get('forcedescription', False) and 'description' in info_dict:
+        if self.params.get('forcedescription', False) and info_dict.get('description') is not None:
             compat_print(info_dict['description'])
         if self.params.get('forcefilename', False) and filename is not None:
             compat_print(filename)