diff options
author | Sergey M․ <dstftw@gmail.com> | 2019-03-06 00:33:08 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2019-03-06 00:33:08 +0700 |
commit | e5ada4f3ad771d4cf3f533efb2597a3f1618ce75 (patch) | |
tree | 84ba6ac7c5302328d7e40f3ce89727ace6a7882c /youtube_dl/extractor | |
parent | bb6f112d9d57d7c6260de132cad604c1c05bc5a0 (diff) |
[extractor/common] Fallback url to base URL for DASH formats
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/common.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 55ce1a888..a17f7cbc4 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -108,7 +108,10 @@ class InfoExtractor(object): for RTMP - RTMP URL, for HLS - URL of the M3U8 media playlist, for HDS - URL of the F4M manifest, - for DASH - URL of the MPD manifest, + for DASH - URL of the MPD manifest or + base URL representing the media + if MPD manifest is parsed from + a string, for MSS - URL of the ISM manifest. * manifest_url The URL of the manifest file in case of @@ -2134,7 +2137,8 @@ class InfoExtractor(object): bandwidth = int_or_none(representation_attrib.get('bandwidth')) f = { 'format_id': '%s-%s' % (mpd_id, representation_id) if mpd_id else representation_id, - 'url': mpd_url, + # NB: mpd_url may be empty when MPD manifest is parsed from a string + 'url': mpd_url or base_url, 'manifest_url': mpd_url, 'ext': mimetype2ext(mime_type), 'width': int_or_none(representation_attrib.get('width')), |