diff options
author | sepro <4618135+seproDev@users.noreply.github.com> | 2024-07-09 01:51:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-09 01:51:43 +0200 |
commit | 0b570f2a90ce2363ba06089217514d644e7be2e0 (patch) | |
tree | cc353034568607d041f868088b894e153d318a0a /yt_dlp/YoutubeDL.py | |
parent | 1a6ac547ea3dbd1814e37dcb6ab14e40fe068ee2 (diff) |
[core] Do not alter default format selection when simulated (#9862)
Closes #9843
Authored by: seproDev
Diffstat (limited to 'yt_dlp/YoutubeDL.py')
-rw-r--r-- | yt_dlp/YoutubeDL.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index e56c3ed3c..fd5aa0118 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -2190,9 +2190,8 @@ class YoutubeDL: or all(f.get('acodec') == 'none' for f in formats)), # OR, No formats with audio })) - def _default_format_spec(self, info_dict, download=True): - download = download and not self.params.get('simulate') - prefer_best = download and ( + def _default_format_spec(self, info_dict): + prefer_best = ( self.params['outtmpl']['default'] == '-' or info_dict.get('is_live') and not self.params.get('live_from_start')) @@ -2200,7 +2199,7 @@ class YoutubeDL: merger = FFmpegMergerPP(self) return merger.available and merger.can_merge() - if not prefer_best and download and not can_merge(): + if not prefer_best and not can_merge(): prefer_best = True formats = self._get_formats(info_dict) evaluate_formats = lambda spec: self._select_formats(formats, self.build_format_selector(spec)) @@ -2959,7 +2958,7 @@ class YoutubeDL: continue if format_selector is None: - req_format = self._default_format_spec(info_dict, download=download) + req_format = self._default_format_spec(info_dict) self.write_debug(f'Default format spec: {req_format}') format_selector = self.build_format_selector(req_format) |