]> jfr.im git - yt-dlp.git/commitdiff
[youtube] De-prioritize auto-generated thumbnails
authorpukkandan <redacted>
Thu, 28 Apr 2022 19:01:34 +0000 (00:31 +0530)
committerpukkandan <redacted>
Fri, 29 Apr 2022 02:11:39 +0000 (07:41 +0530)
Closes #3112

yt_dlp/extractor/youtube.py

index 078f49696ed9d4447d3b3e6dd7e6ee4da76d12bd..037d1d967cc10dd5b11ff51e9a66a3f6003918a6 100644 (file)
@@ -3402,13 +3402,13 @@ def feed_entry(name):
         original_thumbnails = thumbnails.copy()
 
         # The best resolution thumbnails sometimes does not appear in the webpage
-        # See: https://github.com/ytdl-org/youtube-dl/issues/29049, https://github.com/yt-dlp/yt-dlp/issues/340
+        # See: https://github.com/yt-dlp/yt-dlp/issues/340
         # List of possible thumbnails - Ref: <https://stackoverflow.com/a/20542029>
         thumbnail_names = [
-            'maxresdefault', 'hq720', 'sddefault', 'sd1', 'sd2', 'sd3',
-            'hqdefault', 'hq1', 'hq2', 'hq3', '0',
-            'mqdefault', 'mq1', 'mq2', 'mq3',
-            'default', '1', '2', '3'
+            # While the *1,*2,*3 thumbnails are just below their correspnding "*default" variants
+            # in resolution, these are not the custom thumbnail. So de-prioritize them
+            'maxresdefault', 'hq720', 'sddefault', 'hqdefault', '0', 'mqdefault', 'default',
+            'sd1', 'sd2', 'sd3', 'hq1', 'hq2', 'hq3', 'mq1', 'mq2', 'mq3', '1', '2', '3'
         ]
         n_thumbnail_names = len(thumbnail_names)
         thumbnails.extend({