]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/YoutubeDL.py
[youtube] Extract even more thumbnails and reduce testing
[yt-dlp.git] / yt_dlp / YoutubeDL.py
index d4d1af4fd7dda3decd53eee894f0e28636c117e1..3ed104e0fb8dc71016d22dc8f85260ee6ba13dc6 100644 (file)
@@ -1949,12 +1949,15 @@ def _sanitize_thumbnails(self, info_dict):
 
             def thumbnail_tester():
                 if self.params.get('check_formats'):
-                    def to_screen(msg):
-                        return self.to_screen(f'[info] {msg}')
+                    test_all = True
+                    to_screen = lambda msg: self.to_screen(f'[info] {msg}')
                 else:
+                    test_all = False
                     to_screen = self.write_debug
 
                 def test_thumbnail(t):
+                    if not test_all and not t.get('_test_url'):
+                        return True
                     to_screen('Testing thumbnail %s' % t['id'])
                     try:
                         self.urlopen(HEADRequest(t['url']))