[youtube] improve DASH formats file size extraction
authorRemita Amine <remitamine@gmail.com>
Thu, 28 Jan 2021 15:22:24 +0000 (16:22 +0100)
committerRemita Amine <remitamine@gmail.com>
Thu, 28 Jan 2021 15:24:46 +0000 (16:24 +0100)
youtube_dl/extractor/youtube.py

index f57099f8c49525af097cb5cbf7c653512fd7f20f..b254ceceda72d48f4e8f60ed0ad20c559901ebb9 100644 (file)
@@ -2370,7 +2370,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                             mpd_url, video_id, fatal=dash_mpd_fatal,
                             formats_dict=self._formats):
                         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
                         if df['format_id'] not in dash_formats:
                             dash_formats[df['format_id']] = df