]> jfr.im git - yt-dlp.git/commitdiff
Fix `--check-formats`
authorpukkandan <redacted>
Sat, 29 Jul 2023 21:51:35 +0000 (03:21 +0530)
committerpukkandan <redacted>
Sat, 29 Jul 2023 21:53:13 +0000 (03:23 +0530)
Bug in bc344cd456380999c1ee74554dfd432a38f32ec7

yt_dlp/YoutubeDL.py

index c9cf07e5306b2cb438bda04d683850aaaf515e6f..6e8be40ba2d8a1c5f563a64171df81a25d714fd0 100644 (file)
@@ -2339,13 +2339,13 @@ def _merge(formats_pair):
             return new_dict
 
         def _check_formats(formats):
-            if (self.params.get('check_formats') is not None
+            if self.params.get('check_formats') == 'selected':
+                yield from self._check_formats(formats)
+                return
+            elif (self.params.get('check_formats') is not None
                     or self.params.get('allow_unplayable_formats')):
                 yield from formats
                 return
-            elif self.params.get('check_formats') == 'selected':
-                yield from self._check_formats(formats)
-                return
 
             for f in formats:
                 if f.get('has_drm'):