1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

twitch: Fix so we can get live url again

fixes: #385
This commit is contained in:
Johan Andersson 2016-05-02 22:26:30 +02:00
parent 3ea58c0461
commit 45be38c39d

View File

@ -126,18 +126,13 @@ class Twitch(Service):
if method[0] != '/':
method = '/kraken/%s' % method
# There are references to a api_token in global.js; it's used
# with the "Twitch-Api-Token" HTTP header. But it doesn't seem
# to be necessary.
payload = self.http.request("get", url, headers={
'Accept': 'application/vnd.twitchtv.v2+json'
})
payload = self.http.request("get", url)
return json.loads(payload.text)
def _get_hls_url(self, channel):
access = self._get_access_token(channel, "channels")
query = "token=%s&sig=%s" % (quote_plus(access['token']), access['sig'])
query = "token=%s&sig=%s&allow_source=true&allow_spectre=true" % (quote_plus(access['token']), access['sig'])
return "%s/%s.m3u8?%s" % (self.hls_base_url, channel, query)
def _get_channel(self, options, urlp):