@@ -2666,7 +2666,8 @@ def is_wellformed(f):
2666
2666
format ['dynamic_range' ] = 'SDR'
2667
2667
if format .get ('aspect_ratio' ) is None :
2668
2668
format ['aspect_ratio' ] = try_call (lambda : round (format ['width' ] / format ['height' ], 2 ))
2669
- if (info_dict .get ('duration' ) and format .get ('tbr' )
2669
+ if (not format .get ('manifest_url' ) # For fragmented formats, "tbr" is often max bitrate and not average
2670
+ and info_dict .get ('duration' ) and format .get ('tbr' )
2670
2671
and not format .get ('filesize' ) and not format .get ('filesize_approx' )):
2671
2672
format ['filesize_approx' ] = int (info_dict ['duration' ] * format ['tbr' ] * (1024 / 8 ))
2672
2673
format ['http_headers' ] = self ._calc_headers (collections .ChainMap (format , info_dict ))
@@ -3707,8 +3708,11 @@ def simplified_codec(f, field):
3707
3708
format_field (f , 'fps' , '\t %d' , func = round ),
3708
3709
format_field (f , 'dynamic_range' , '%s' , ignore = (None , 'SDR' )).replace ('HDR' , '' ),
3709
3710
format_field (f , 'audio_channels' , '\t %s' ),
3710
- delim ,
3711
- format_field (f , 'filesize' , ' \t %s' , func = format_bytes ) + format_field (f , 'filesize_approx' , '~\t %s' , func = format_bytes ),
3711
+ delim , (
3712
+ format_field (f , 'filesize' , ' \t %s' , func = format_bytes )
3713
+ or format_field (f , 'filesize_approx' , '≈\t %s' , func = format_bytes )
3714
+ or format_field (try_call (lambda : format_bytes (int (info_dict ['duration' ] * f ['tbr' ] * (1024 / 8 )))),
3715
+ None , self ._format_out ('~\t %s' , self .Styles .SUPPRESS ))),
3712
3716
format_field (f , 'tbr' , '\t %dk' , func = round ),
3713
3717
shorten_protocol_name (f .get ('protocol' , '' )),
3714
3718
delim ,
0 commit comments