From 90117052749121cd65d65c6dfd7bcafcfc2ab78d Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 4 Oct 2015 14:33:54 +0200 Subject: [PATCH] hls: have the same interface as hds --- lib/svtplay_dl/fetcher/hls.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/svtplay_dl/fetcher/hls.py b/lib/svtplay_dl/fetcher/hls.py index e0f1ff5..e8a4817 100644 --- a/lib/svtplay_dl/fetcher/hls.py +++ b/lib/svtplay_dl/fetcher/hls.py @@ -4,6 +4,7 @@ from __future__ import absolute_import import sys import os import re +import copy from svtplay_dl.output import progressbar, progress_stream, ETA, output from svtplay_dl.log import log @@ -41,13 +42,13 @@ def _get_full_url(url, srcurl): return returl -def hlsparse(url, data): - files = (parsem3u(data))[1] +def hlsparse(options, res, url): + files = (parsem3u(res.text))[1] streams = {} for i in files: bitrate = float(i[1]["BANDWIDTH"])/1000 - streams[int(bitrate)] = _get_full_url(i[0], url) + streams[int(bitrate)] = HLS(copy.copy(options), _get_full_url(i[0], url), bitrate, cookies=res.cookies) return streams