[extractor/common] Improve mpd base URL extraction (closes #10909, closes #11079)

This commit is contained in:
Sergey M․ 2016-11-01 01:15:46 +07:00
parent e5a088dc4b
commit b82c33dd67
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -1539,7 +1539,7 @@ def _extract_mpd_formats(self, mpd_url, video_id, mpd_id=None, note=None, errnot
if res is False: if res is False:
return [] return []
mpd, urlh = res mpd, urlh = res
mpd_base_url = re.match(r'https?://.+/', urlh.geturl()).group() mpd_base_url = re.match(r'https?://[^?#&]+/', urlh.geturl()).group()
return self._parse_mpd_formats( return self._parse_mpd_formats(
compat_etree_fromstring(mpd.encode('utf-8')), mpd_id, mpd_base_url, compat_etree_fromstring(mpd.encode('utf-8')), mpd_id, mpd_base_url,