]> jfr.im git - yt-dlp.git/commitdiff
Fix `--list` options not implying `-s` in some cases (#5296)
authorbashonly <redacted>
Fri, 11 Nov 2022 08:54:57 +0000 (08:54 +0000)
committerGitHub <redacted>
Fri, 11 Nov 2022 08:54:57 +0000 (14:24 +0530)
Authored by: bashonly, Grub4K

yt_dlp/YoutubeDL.py

index 92b802da6e971eb08e2ca236d21f2030a829c0d1..1efcfc2e4b519ca29292f7deee896c924b175666 100644 (file)
@@ -672,6 +672,13 @@ def check_deprecated(param, option, suggestion):
         else:
             self.params['nooverwrites'] = not self.params['overwrites']
 
+        if self.params.get('simulate') is None and any((
+            self.params.get('list_thumbnails'),
+            self.params.get('listformats'),
+            self.params.get('listsubtitles'),
+        )):
+            self.params['simulate'] = 'list_only'
+
         self.params.setdefault('forceprint', {})
         self.params.setdefault('print_to_file', {})
 
@@ -2643,8 +2650,7 @@ def is_wellformed(f):
         # The pre-processors may have modified the formats
         formats = self._get_formats(info_dict)
 
-        list_only = self.params.get('simulate') is None and (
-            self.params.get('list_thumbnails') or self.params.get('listformats') or self.params.get('listsubtitles'))
+        list_only = self.params.get('simulate') == 'list_only'
         interactive_format_selection = not list_only and self.format_selector == '-'
         if self.params.get('list_thumbnails'):
             self.list_thumbnails(info_dict)