diff options
author | bashonly <88596187+bashonly@users.noreply.github.com> | 2022-11-11 08:54:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-11 14:24:57 +0530 |
commit | e4221b700f01acd96fe6a03c20d57c59be6f1f7f (patch) | |
tree | 028c4315d2be838005c3c1faaa1fc19bb39af493 | |
parent | bd7e919a75cd264daabbe50137b2a7c89390c68c (diff) | |
download | hypervideo-pre-e4221b700f01acd96fe6a03c20d57c59be6f1f7f.tar.lz hypervideo-pre-e4221b700f01acd96fe6a03c20d57c59be6f1f7f.tar.xz hypervideo-pre-e4221b700f01acd96fe6a03c20d57c59be6f1f7f.zip |
Fix `--list` options not implying `-s` in some cases (#5296)
Authored by: bashonly, Grub4K
-rw-r--r-- | yt_dlp/YoutubeDL.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 92b802da6..1efcfc2e4 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -672,6 +672,13 @@ class YoutubeDL: 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 @@ class YoutubeDL: # 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) |