From 91ad3aa98cf3dd355f78b106449adc47729c8977 Mon Sep 17 00:00:00 2001 From: intact Date: Tue, 25 Oct 2016 21:23:46 +0200 Subject: [PATCH] plugins.goodgame: Update for API change --- src/livestreamer/plugins/goodgame.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/livestreamer/plugins/goodgame.py b/src/livestreamer/plugins/goodgame.py index c8482f9d..76c46cd0 100644 --- a/src/livestreamer/plugins/goodgame.py +++ b/src/livestreamer/plugins/goodgame.py @@ -4,7 +4,7 @@ from livestreamer.plugin.api import http from livestreamer.stream import HLSStream -HLS_URL_FORMAT = "http://hls.goodgame.ru/hls/{0}{1}.m3u8" +HLS_URL_FORMAT = "https://hls.goodgame.ru/hls/{0}{1}.m3u8" QUALITIES = { "1080p": "", "720p": "_720", @@ -12,13 +12,8 @@ "240p": "_240" } -_url_re = re.compile("http://(?:www\.)?goodgame.ru/channel/(?P\w+)") -_stream_re = re.compile( - "iframe frameborder=\"0\" width=\"100%\" height=\"100%\" src=\"http://goodgame.ru/player(\d)?\?(\w+)\"" -) -_ddos_re = re.compile( - "document.cookie=\"(__DDOS_[^;]+)" -) +_url_re = re.compile("https://(?:www\.)?goodgame.ru/channel/(?P\w+)") +_stream_re = re.compile(r'var src = "([^"]+)";') class GoodGame(Plugin): @classmethod @@ -36,16 +31,11 @@ def _get_streams(self): } res = http.get(self.url, headers=headers) - match = _ddos_re.search(res.text) - if (match): - headers["Cookie"] = match.group(1) - res = http.get(self.url, headers=headers) - match = _stream_re.search(res.text) if not match: return - stream_id = match.group(2) + stream_id = match.group(1) streams = {} for name, url_suffix in QUALITIES.items(): url = HLS_URL_FORMAT.format(stream_id, url_suffix)