1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-17 18:58:35 +00:00

Only add filesize if found, rather than using int_or_none

Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
flanter21 2025-07-16 16:10:19 +03:00 committed by GitHub
parent 26d59b5c1d
commit 2fad19eea0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,8 +125,9 @@ def _real_extract(self, url):
'aspect_ratio': ('aspectRatio', {float_or_none}),
}))
for cur_format in formats:
cur_format['filesize'] = int_or_none(video_extra.get('storageSize'))
if filesize := traverse_obj(video_extract, ('storageSize', {int_or_none})):
for fmt in formats:
fmt['filesize'] = filesize
subtitles = {}
for current_subs in video_info.get('subtitles'):