Skip to content

Commit c132d2a

Browse files
authored
Merge pull request #64 from anxdpanic/dev
2.0.7
2 parents dd5ff25 + 2a8d13b commit c132d2a

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

addon.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="script.module.python.twitch" name="python-twitch for Kodi" version="2.0.6" provider-name="A Talented Community">
2+
<addon id="script.module.python.twitch" name="python-twitch for Kodi" version="2.0.7" provider-name="A Talented Community">
33
<requires>
44
<import addon="xbmc.python" version="2.20.0"/>
55
<import addon="script.module.six" version="1.11.0"/>
@@ -9,7 +9,7 @@
99
<extension point="xbmc.addon.metadata">
1010
<platform>all</platform>
1111
<news>
12-
[add] add missing helix api endpoints
12+
[add] add platform parameter to usher
1313
</news>
1414
<assets>
1515
<icon>icon.png</icon>

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2.0.7
2+
[add] add platform parameter to usher
3+
14
2.0.6
25
[add] add missing helix api endpoints
36

resources/lib/twitch/api/usher.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ def valid_video_id(video_id):
3030

3131

3232
@query
33-
def channel_token(channel):
33+
def channel_token(channel, platform=keys.WEB):
3434
q = HiddenApiQuery('channels/{channel}/access_token')
3535
q.add_urlkw(keys.CHANNEL, channel)
3636
q.add_param(keys.NEED_HTTPS, Boolean.TRUE)
37-
q.add_param(keys.PLATFORM, keys.WEB)
37+
q.add_param(keys.PLATFORM, platform)
3838
q.add_param(keys.PLAYER_BACKEND, keys.MEDIAPLAYER)
3939
return q
4040

4141

4242
@query
43-
def vod_token(video_id):
43+
def vod_token(video_id, platform=keys.WEB):
4444
q = HiddenApiQuery('vods/{vod}/access_token')
4545
q.add_urlkw(keys.VOD, video_id)
4646
q.add_param(keys.NEED_HTTPS, Boolean.TRUE)
47-
q.add_param(keys.PLATFORM, keys.WEB)
47+
q.add_param(keys.PLATFORM, platform)
4848
q.add_param(keys.PLAYER_BACKEND, keys.MEDIAPLAYER)
4949
return q
5050

@@ -56,8 +56,8 @@ def _legacy_video(video_id):
5656
return q
5757

5858

59-
def live_request(channel):
60-
token = channel_token(channel)
59+
def live_request(channel, platform=keys.WEB):
60+
token = channel_token(channel, platform=platform)
6161
if keys.ERROR in token:
6262
return token
6363
else:
@@ -99,18 +99,18 @@ def _live(channel, token):
9999

100100

101101
@m3u8
102-
def live(channel):
103-
token = channel_token(channel)
102+
def live(channel, platform=keys.WEB):
103+
token = channel_token(channel, platform=platform)
104104
if keys.ERROR in token:
105105
return token
106106
else:
107107
return _live(channel, token)
108108

109109

110-
def video_request(video_id):
110+
def video_request(video_id, platform=keys.WEB):
111111
video_id = valid_video_id(video_id)
112112
if video_id:
113-
token = vod_token(video_id)
113+
token = vod_token(video_id, platform=platform)
114114
if keys.ERROR in token:
115115
return token
116116
else:
@@ -156,10 +156,10 @@ def _vod(video_id, token):
156156

157157

158158
@m3u8
159-
def video(video_id):
159+
def video(video_id, platform=keys.WEB):
160160
video_id = valid_video_id(video_id)
161161
if video_id:
162-
token = vod_token(video_id)
162+
token = vod_token(video_id, platform=platform)
163163
if keys.ERROR in token:
164164
return token
165165
else:

0 commit comments

Comments
 (0)