浏览代码

[extractor/common] Improve base url construction

Sergey M․ 9 年之前
父节点
当前提交
bb20526b64
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      youtube_dl/extractor/common.py

+ 3 - 1
youtube_dl/extractor/common.py

@@ -1435,7 +1435,9 @@ class InfoExtractor(object):
                                 base_url = base_url_e.text + base_url
                                 if re.match(r'^https?://', base_url):
                                     break
-                        if not re.match(r'^https?://', base_url):
+                        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 += '/'
                             base_url = mpd_base_url + base_url
                         representation_id = representation_attrib.get('id')
                         lang = representation_attrib.get('lang')