Skip to content

Commit a9428ec

Browse files
authored
Merge pull request #50 from anxdpanic/dev
2.0.4~beta1
2 parents 11d7a63 + 5602496 commit a9428ec

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

addon.xml

+2-2
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.3" provider-name="A Talented Community">
2+
<addon id="script.module.python.twitch" name="python-twitch for Kodi" version="2.0.4~beta1" provider-name="A Talented Community">
33
<requires>
44
<import addon="xbmc.python" version="2.20.0"/>
55
<import addon="script.module.six" version="1.9.0"/>
@@ -9,7 +9,7 @@
99
<extension point="xbmc.addon.metadata">
1010
<platform>all</platform>
1111
<news>
12-
[chg] redact user ip from token logging
12+
[fix] video/live stream token encoding
1313
</news>
1414
<assets>
1515
<icon>icon.png</icon>

changelog.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2.0.4
2+
[fix] video/live stream token encoding
3+
14
2.0.3
25
[chg] redact user ip from token logging
36

resources/lib/twitch/api/usher.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def live_request(channel):
4949
else:
5050
q = UsherQuery('api/channel/hls/{channel}.m3u8')
5151
q.add_urlkw(keys.CHANNEL, channel)
52-
q.add_param(keys.SIG, token[keys.SIG])
53-
q.add_param(keys.TOKEN, token[keys.TOKEN])
52+
q.add_param(keys.SIG, token[keys.SIG].encode('utf-8'))
53+
q.add_param(keys.TOKEN, token[keys.TOKEN].encode('utf-8'))
5454
q.add_param(keys.ALLOW_SOURCE, Boolean.TRUE)
5555
q.add_param(keys.ALLOW_SPECTRE, Boolean.TRUE)
5656
q.add_param(keys.ALLOW_AUDIO_ONLY, Boolean.TRUE)
@@ -65,8 +65,8 @@ def live_request(channel):
6565
def _live(channel, token):
6666
q = UsherQuery('api/channel/hls/{channel}.m3u8')
6767
q.add_urlkw(keys.CHANNEL, channel)
68-
q.add_param(keys.SIG, token[keys.SIG])
69-
q.add_param(keys.TOKEN, token[keys.TOKEN])
68+
q.add_param(keys.SIG, token[keys.SIG].encode('utf-8'))
69+
q.add_param(keys.TOKEN, token[keys.TOKEN].encode('utf-8'))
7070
q.add_param(keys.ALLOW_SOURCE, Boolean.TRUE)
7171
q.add_param(keys.ALLOW_SPECTRE, Boolean.TRUE)
7272
q.add_param(keys.ALLOW_AUDIO_ONLY, Boolean.TRUE)
@@ -92,8 +92,8 @@ def video_request(video_id):
9292
else:
9393
q = UsherQuery('vod/{id}')
9494
q.add_urlkw(keys.ID, video_id)
95-
q.add_param(keys.NAUTHSIG, token[keys.SIG])
96-
q.add_param(keys.NAUTH, token[keys.TOKEN])
95+
q.add_param(keys.NAUTHSIG, token[keys.SIG].encode('utf-8'))
96+
q.add_param(keys.NAUTH, token[keys.TOKEN].encode('utf-8'))
9797
q.add_param(keys.ALLOW_SOURCE, Boolean.TRUE)
9898
q.add_param(keys.ALLOW_AUDIO_ONLY, Boolean.TRUE)
9999
url = '?'.join([q.url, urlencode(q.params)])
@@ -108,8 +108,8 @@ def video_request(video_id):
108108
def _vod(video_id, token):
109109
q = UsherQuery('vod/{id}')
110110
q.add_urlkw(keys.ID, video_id)
111-
q.add_param(keys.NAUTHSIG, token[keys.SIG])
112-
q.add_param(keys.NAUTH, token[keys.TOKEN])
111+
q.add_param(keys.NAUTHSIG, token[keys.SIG].encode('utf-8'))
112+
q.add_param(keys.NAUTH, token[keys.TOKEN].encode('utf-8'))
113113
q.add_param(keys.ALLOW_SOURCE, Boolean.TRUE)
114114
q.add_param(keys.ALLOW_AUDIO_ONLY, Boolean.TRUE)
115115
return q

0 commit comments

Comments
 (0)