aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/YoutubeDL.py
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2023-11-07 17:10:01 -0600
committerGitHub <noreply@github.com>2023-11-07 23:10:01 +0000
commit10025b715ea01489557eb2c5a3cc04d361fcdb52 (patch)
tree63453a2058ebdcdeb215957db45894d7f3b9bd26 /yt_dlp/YoutubeDL.py
parent595ea4a99b726b8fe9463e7853b7053978d0544e (diff)
[core] Add `--compat-option manifest-filesize-approx` (#8356)
Closes #7623 Authored by: bashonly
Diffstat (limited to 'yt_dlp/YoutubeDL.py')
-rw-r--r--yt_dlp/YoutubeDL.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index d5c0a2422..fb8e89443 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -2764,7 +2764,8 @@ class YoutubeDL:
format['dynamic_range'] = 'SDR'
if format.get('aspect_ratio') is None:
format['aspect_ratio'] = try_call(lambda: round(format['width'] / format['height'], 2))
- if (not format.get('manifest_url') # For fragmented formats, "tbr" is often max bitrate and not average
+ # For fragmented formats, "tbr" is often max bitrate and not average
+ if (('manifest-filesize-approx' in self.params['compat_opts'] or not format.get('manifest_url'))
and info_dict.get('duration') and format.get('tbr')
and not format.get('filesize') and not format.get('filesize_approx')):
format['filesize_approx'] = int(info_dict['duration'] * format['tbr'] * (1024 / 8))