github.com

Approximate filesize from bitrate · yt-dlp/yt-dlp@f2fe69c

  • ️Invalid Date

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

Original file line number Diff line number Diff line change
Expand Up @@ -2330,6 +2330,10 @@ def is_wellformed(f):
format['resolution'] = self.format_resolution(format, default=None)
if format.get('dynamic_range') is None and format.get('vcodec') != 'none':
format['dynamic_range'] = 'SDR'
if (info_dict.get('duration') and format.get('tbr')
and not format.get('filesize') and not format.get('filesize_approx')):
format['filesize_approx'] = info_dict['duration'] * format['tbr'] * (1024 / 8)

# Add HTTP headers, so that external programs can use them from the
# json output
full_format_info = info_dict.copy()
Expand Down