Skip to content

Commit c932bc0

Browse files
committed
add support offline playlists
1 parent c47f184 commit c932bc0

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

resources/lib/twitch/api/usher.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
def channel_token(channel):
1515
q = HiddenApiQuery('channels/{channel}/access_token')
1616
q.add_urlkw(keys.CHANNEL, channel)
17+
q.add_param(keys.NEED_HTTPS, Boolean.TRUE)
1718
return q
1819

1920

2021
@query
2122
def vod_token(video_id):
2223
q = HiddenApiQuery('vods/{vod}/access_token')
2324
q.add_urlkw(keys.VOD, video_id)
25+
q.add_param(keys.NEED_HTTPS, Boolean.TRUE)
2426
return q
2527

2628

@@ -41,6 +43,7 @@ def live(channel):
4143
q.add_param(keys.SIG, token[keys.SIG])
4244
q.add_param(keys.TOKEN, token[keys.TOKEN])
4345
q.add_param(keys.ALLOW_SOURCE, Boolean.TRUE)
46+
q.add_param(keys.ALLOW_SPECTRE, Boolean.TRUE)
4447
return q
4548

4649

resources/lib/twitch/api/v5/streams.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99

1010
@query
11-
def by_id(channel_id):
11+
def by_id(channel_id, stream_type=StreamType.LIVE):
1212
q = Qry('streams/{id}')
1313
q.add_urlkw(keys.ID, channel_id)
14+
q.add_param(keys.STREAM_TYPE, StreamType.validate(stream_type), StreamType.LIVE)
1415
return q
1516

1617

resources/lib/twitch/keys.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
ALLOW_SOURCE = 'allow_source'
9+
ALLOW_SPECTRE = 'allow_spectre'
910
BROADCAST_TYPE = 'broadcast_type'
1011
BROADCASTS = 'broadcasts'
1112
CHANNEL = 'channel'
@@ -28,6 +29,7 @@
2829
NAME = 'name'
2930
NAUTH = 'nauth'
3031
NAUTHSIG = 'nauthsig'
32+
NEED_HTTPS = 'need_https'
3133
NOTIFICATION = 'notification'
3234
OFFSET = 'offset'
3335
PERIOD = 'period'

0 commit comments

Comments
 (0)