[youtube] improve DASH formats file size extraction

pull/28004/head
Remita Amine 2021-01-28 16:22:24 +01:00
parent 7b8fa658f8
commit 0b4f03a563
1 changed files with 1 additions and 1 deletions

View File

@ -2370,7 +2370,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
mpd_url, video_id, fatal=dash_mpd_fatal, mpd_url, video_id, fatal=dash_mpd_fatal,
formats_dict=self._formats): formats_dict=self._formats):
if not df.get('filesize'): if not df.get('filesize'):
df['filesize'] = _extract_filesize(df['url']) df['filesize'] = _extract_filesize(df.get('fragment_base_url') or df['url'])
# Do not overwrite DASH format found in some previous DASH manifest # Do not overwrite DASH format found in some previous DASH manifest
if df['format_id'] not in dash_formats: if df['format_id'] not in dash_formats:
dash_formats[df['format_id']] = df dash_formats[df['format_id']] = df