From bdf7a181ea8056c4ecb1c457961410f447714b59 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 4 Sep 2016 20:43:37 +0200 Subject: [PATCH] hls: if the file start with / add hostname to it. --- lib/svtplay_dl/fetcher/hls.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/svtplay_dl/fetcher/hls.py b/lib/svtplay_dl/fetcher/hls.py index 8630737..2660fb8 100644 --- a/lib/svtplay_dl/fetcher/hls.py +++ b/lib/svtplay_dl/fetcher/hls.py @@ -27,6 +27,9 @@ class LiveHLSException(HLSException): def _get_full_url(url, srcurl): if url[:4] == 'http': return url + if url[0] == '/': + baseurl = re.search(r'^(http[s]{0,1}://[^/]+)/', srcurl) + return "%s%s" % (baseurl.group(1), url) # remove everything after last / in the path of the URL baseurl = re.sub(r'^([^\?]+)/[^/]*(\?.*)?$', r'\1', srcurl)