[YoutubeDL] set the 'thumbnails' field if the info_dict has the 'thumbnails' field
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Thu, 29 Jan 2015 19:15:38 +0000 (20:15 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Thu, 29 Jan 2015 19:15:38 +0000 (20:15 +0100)
Since the '--write-thumbnail' uses the 'thumbnails' field and we didn't updated the info_dict, it wouldn't detect the thumbnail. (fixes #4812)

youtube_dl/YoutubeDL.py

index 4c238c55507159206aa41f779f2a810ef37d87f4..14e92ddcf7258d60b38b8816005b089a0801cb37 100755 (executable)
@@ -958,7 +958,7 @@ class YoutubeDL(object):
         if thumbnails is None:
             thumbnail = info_dict.get('thumbnail')
             if thumbnail:
-                thumbnails = [{'url': thumbnail}]
+                info_dict['thumbnails'] = thumbnails = [{'url': thumbnail}]
         if thumbnails:
             thumbnails.sort(key=lambda t: (
                 t.get('preference'), t.get('width'), t.get('height'),