mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
parent
3ea58c0461
commit
45be38c39d
@ -126,18 +126,13 @@ class Twitch(Service):
|
|||||||
if method[0] != '/':
|
if method[0] != '/':
|
||||||
method = '/kraken/%s' % method
|
method = '/kraken/%s' % method
|
||||||
|
|
||||||
# There are references to a api_token in global.js; it's used
|
payload = self.http.request("get", url)
|
||||||
# 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'
|
|
||||||
})
|
|
||||||
return json.loads(payload.text)
|
return json.loads(payload.text)
|
||||||
|
|
||||||
def _get_hls_url(self, channel):
|
def _get_hls_url(self, channel):
|
||||||
access = self._get_access_token(channel, "channels")
|
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)
|
return "%s/%s.m3u8?%s" % (self.hls_base_url, channel, query)
|
||||||
|
|
||||||
def _get_channel(self, options, urlp):
|
def _get_channel(self, options, urlp):
|
||||||
|
Loading…
Reference in New Issue
Block a user