diff --git a/test/test_InfoExtractor.py b/test/test_InfoExtractor.py index f18a823fc..0dc4cc6b0 100644 --- a/test/test_InfoExtractor.py +++ b/test/test_InfoExtractor.py @@ -563,6 +563,23 @@ jwplayer("mediaplayer").setup({"abouttext":"Visit Indie DB","aboutlink":"http:\/ 'height': 1080, }] ), + ( + # https://github.com/rg3/youtube-dl/issues/13784 + 'thisav', + 'http://unknown/manifest.mpd', + [{ + 'url': 'http://unknown/300708_dashinit.mp4', + 'manifest_url': 'http://unknown/manifest.mpd', + 'ext': 'mp4', + 'format_note': 'DASH video', + 'protocol': None, + 'acodec': 'mp4a.40.2', + 'vcodec': 'avc3.64001e', + 'tbr': 574.578, + 'width': 640, + 'height': 426, + }] + ) ] for mpd_file, mpd_url, expected_formats in _TEST_CASES: diff --git a/test/testdata/mpd/thisav.mpd b/test/testdata/mpd/thisav.mpd new file mode 100644 index 000000000..4cb397fb0 --- /dev/null +++ b/test/testdata/mpd/thisav.mpd @@ -0,0 +1,141 @@ + + + + + 300708 + + + + + + + + + 300708_dashinit.mp4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index ddbc04050..c6691e3b8 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -1864,6 +1864,9 @@ class InfoExtractor(object): base_url = base_url_e.text + base_url if re.match(r'^https?://', base_url): break + if mpd_base_url == '' and re.match(r'^https?://', mpd_url): + mpd_base_url = "/".join(mpd_url.split("/")[0:-1]) + if mpd_base_url and not re.match(r'^https?://', base_url): if not mpd_base_url.endswith('/') and not base_url.startswith('/'): mpd_base_url += '/'