Skip to content

Commit

Permalink
Approximate filesize from bitrate
Browse files Browse the repository at this point in the history
Closes #1400
  • Loading branch information
pukkandan committed Oct 24, 2021
1 parent fccf502 commit f2fe69c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yt_dlp/YoutubeDL.py
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

0 comments on commit f2fe69c

Please sign in to comment.