From c6d9a5732d30810cfc5c6ad410fc45d6a9f99d2f Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 4 Oct 2015 14:36:06 +0200 Subject: [PATCH] hls: handle cookies --- lib/svtplay_dl/fetcher/hls.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/svtplay_dl/fetcher/hls.py b/lib/svtplay_dl/fetcher/hls.py index e8a4817..7da4658 100644 --- a/lib/svtplay_dl/fetcher/hls.py +++ b/lib/svtplay_dl/fetcher/hls.py @@ -60,7 +60,8 @@ class HLS(VideoRetriever): if self.options.live and not self.options.force: raise LiveHLSException(self.url) - m3u8 = self.http.request("get", self.url).text + cookies = self.kwargs["cookies"] + m3u8 = self.http.request("get", self.url, cookies=cookies).text globaldata, files = parsem3u(m3u8) encrypted = False key = None @@ -94,7 +95,7 @@ class HLS(VideoRetriever): progressbar(len(files), n, ''.join(['ETA: ', str(eta)])) n += 1 - data = self.http.request("get", item) + data = self.http.request("get", item, cookies=cookies) if data.status_code == 404: break data = data.content