[cnn] Improve thumbnail extraction
[youtube-dl] / youtube_dl / YoutubeDL.py
index 455c0a7b0e1d93d8a4db9ca5543ba0f6a5fa1fe8..dc0ba986a98744151cafd932acbcd6bbe33fb4a0 100755 (executable)
@@ -719,6 +719,8 @@ class YoutubeDL(object):
 
         thumbnails = info_dict.get('thumbnails')
         if thumbnails:
+            thumbnails.sort(key=lambda t: (
+                t.get('width'), t.get('height'), t.get('url')))
             for t in thumbnails:
                 if 'width' in t and 'height' in t:
                     t['resolution'] = '%dx%d' % (t['width'], t['height'])