1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-28 06:04:17 +01:00

hls: we select quality before we go here.

This commit is contained in:
Johan Andersson 2014-04-27 10:42:13 +02:00
parent e53142b02c
commit 850eabf276

View File

@ -56,20 +56,7 @@ class HLS(VideoRetriever):
if self.options.live and not self.options.force: if self.options.live and not self.options.force:
raise LiveHLSException(self.url) raise LiveHLSException(self.url)
data = get_http_data(self.url) m3u8 = get_http_data(self.url)
globaldata, files = parsem3u(data)
streams = {}
if self.options.live and not self.options.force:
raise LiveHLSException(self.url)
for i in files:
streams[int(i[1]["BANDWIDTH"])] = i[0]
test = select_quality(self.options, streams)
test = _get_full_url(test, self.url)
m3u8 = get_http_data(test)
globaldata, files = parsem3u(m3u8) globaldata, files = parsem3u(m3u8)
encrypted = False encrypted = False
key = None key = None
@ -102,7 +89,7 @@ class HLS(VideoRetriever):
n = 0 n = 0
eta = ETA(len(files)) eta = ETA(len(files))
for i in files: for i in files:
item = _get_full_url(i[0], test) item = _get_full_url(i[0], self.url)
if self.options.output != "-": if self.options.output != "-":
eta.increment() eta.increment()