diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-11-02 02:14:01 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-11-02 02:30:18 +0700 |
commit | 02dc0a36b72b7312996d59b9ec96768f925cb4a4 (patch) | |
tree | 9131cde2d8f6ed7463b1254a33fada2ed8530d73 /youtube_dl/extractor/common.py | |
parent | 639e3b5c9985aacf7c0dc018c211a78161bbafd2 (diff) |
[utils] Introduce base_url
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r-- | youtube_dl/extractor/common.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 2e9f05ae3..140ccf234 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -30,6 +30,7 @@ from ..downloader.f4m import remove_encrypted_media from ..utils import ( NO_DEFAULT, age_restricted, + base_url, bug_reports_message, clean_html, compiled_regex_type, @@ -1539,7 +1540,7 @@ class InfoExtractor(object): if res is False: return [] mpd, urlh = res - mpd_base_url = re.match(r'https?://[^?#&]+/', urlh.geturl()).group() + mpd_base_url = base_url(urlh.geturl()) return self._parse_mpd_formats( compat_etree_fromstring(mpd.encode('utf-8')), mpd_id, mpd_base_url, @@ -1797,7 +1798,7 @@ class InfoExtractor(object): if ism_doc.get('IsLive') == 'TRUE' or ism_doc.find('Protection') is not None: return [] - ism_base_url = re.match(r'https?://.+/', ism_url).group() + ism_base_url = base_url(ism_url) duration = int(ism_doc.attrib['Duration']) timescale = int_or_none(ism_doc.get('TimeScale')) or 10000000 |