Skip to content

Commit 3ccc4ad

Browse files
authored
Merge pull request #29 from anxdpanic/dev
[fix] omit oauth token for queries with 'required scope: none'
2 parents f452e68 + 3f64e2d commit 3ccc4ad

File tree

16 files changed

+37
-39
lines changed

16 files changed

+37
-39
lines changed

addon.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
<extension point="xbmc.addon.metadata">
1010
<platform>all</platform>
1111
<news>
12-
[fix] omit oauth token for collections 'by_id' queries
13-
[fix] omit oauth token for collections 'get_collections' queries
12+
[fix] omit oauth token for queries with 'required scope: none'
1413
</news>
1514
<assets>
1615
<icon>icon.png</icon>

changelog.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
1.0.2
2-
[fix] omit oauth token for collections 'by_id' queries
3-
[fix] omit oauth token for collections 'get_collections' queries
2+
[fix] omit oauth token for queries with 'required scope: none'
43

54
1.0.1
65
[fix/upd] offset, limit to games _get_followed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
# required scope: None
1010
@query
1111
def get_cheermotes(channel_id=None):
12-
q = Qry('bits/actions')
12+
q = Qry('bits/actions', use_token=False)
1313
q.add_param(keys.CHANNEL_ID, channel_id, None)
1414
return q

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def channel():
1717
# required scope: none
1818
@query
1919
def by_id(channel_id):
20-
q = Qry('channels/{channel_id}')
20+
q = Qry('channels/{channel_id}', use_token=False)
2121
q.add_urlkw(keys.CHANNEL_ID, channel_id)
2222
return q
2323

@@ -51,7 +51,7 @@ def get_editors(channel_id):
5151
# required scope: none
5252
@query
5353
def get_followers(channel_id, limit=25, offset=0, cursor='MA==', direction=Direction.DESC):
54-
q = Qry('channels/{channel_id}/follows')
54+
q = Qry('channels/{channel_id}/follows', use_token=False)
5555
q.add_urlkw(keys.CHANNEL_ID, channel_id)
5656
q.add_param(keys.LIMIT, limit, 25)
5757
q.add_param(keys.OFFSET, offset, 0)
@@ -63,7 +63,7 @@ def get_followers(channel_id, limit=25, offset=0, cursor='MA==', direction=Direc
6363
# required scope: none
6464
@query
6565
def get_teams(channel_id):
66-
q = Qry('channels/{channel_id}/teams')
66+
q = Qry('channels/{channel_id}/teams', use_token=False)
6767
q.add_urlkw(keys.CHANNEL_ID, channel_id)
6868
return q
6969

@@ -94,7 +94,7 @@ def get_videos(channel_id, limit=10, offset=0,
9494
broadcast_type=BroadcastType.HIGHLIGHT,
9595
hls=Boolean.FALSE, sort_by=VideoSort.TIME,
9696
language=Language.ALL):
97-
q = Qry('channels/{id}/videos')
97+
q = Qry('channels/{id}/videos', use_token=False)
9898
q.add_urlkw(keys.ID, channel_id)
9999
q.add_param(keys.LIMIT, limit, 10)
100100
q.add_param(keys.OFFSET, offset, 0)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
# required scope: none
1010
@query
1111
def get_emoticons_by_set(emotesets=None):
12-
q = Qry('chat/emoticon_images')
12+
q = Qry('chat/emoticon_images', use_token=False)
1313
q.add_param(keys.EMOTESETS, emotesets, None)
1414
return q
1515

1616

1717
# required scope: none
1818
@query
1919
def get_badges(channel_id):
20-
q = Qry('chat/{channel_id}/badges')
20+
q = Qry('chat/{channel_id}/badges', use_token=False)
2121
q.add_urlkw(keys.CHANNEL_ID, channel_id)
2222
return q
2323

2424

2525
# required scope: none
2626
@query
2727
def get_emoticons():
28-
q = Qry('chat/emoticons')
28+
q = Qry('chat/emoticons', use_token=False)
2929
return q

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# required scope: None
1111
@query
1212
def by_slug(slug):
13-
q = Qry('clips/{slug}')
13+
q = Qry('clips/{slug}', use_token=False)
1414
q.add_urlkw(keys.SLUG, slug)
1515
return q
1616

@@ -19,7 +19,7 @@ def by_slug(slug):
1919
@query
2020
def get_top(channels=None, games=None, period=ClipPeriod.WEEK, trending=Boolean.FALSE,
2121
language=Language.ALL, cursor='MA==', limit=10):
22-
q = Qry('clips/top')
22+
q = Qry('clips/top', use_token=False)
2323
q.add_param(keys.CHANNEL, channels, None)
2424
q.add_param(keys.GAME, games, None)
2525
q.add_param(keys.PERIOD, ClipPeriod.validate(period), ClipPeriod.WEEK)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# required scope: none
1111
@query
1212
def get_metadata(collection_id):
13-
q = Qry('collections/{collection_id}')
13+
q = Qry('collections/{collection_id}', use_token=False)
1414
q.add_urlkw(keys.COLLECTION_ID, collection_id)
1515
return q
1616

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
# required scope: none
1111
@query
1212
def by_name(name):
13-
q = Qry('communities')
13+
q = Qry('communities', use_token=False)
1414
q.add_param(keys.NAME, name)
1515
return q
1616

1717

1818
# required scope: none
1919
@query
2020
def by_id(community_id):
21-
q = Qry('communities/{community_id}')
21+
q = Qry('communities/{community_id}', use_token=False)
2222
q.add_urlkw(keys.COMMUNITY_ID, community_id)
2323
return q
2424

@@ -39,7 +39,7 @@ def update(community_id, summary=None, description=None,
3939
# required scope: none
4040
@query
4141
def get_top(limit=10, cursor='MA=='):
42-
q = Qry('communities/top')
42+
q = Qry('communities/top', use_token=False)
4343
q.add_param(keys.LIMIT, limit, 10)
4444
q.add_param(keys.CURSOR, Cursor.validate(cursor), 'MA==')
4545
return q
@@ -144,7 +144,7 @@ def get_permissions(community_id):
144144
# required scope: none
145145
@query
146146
def report_violation(community_id, channel_id):
147-
q = Qry('communities/{community_id}/report_channel', method=methods.POST)
147+
q = Qry('communities/{community_id}/report_channel', use_token=False, method=methods.POST)
148148
q.add_urlkw(keys.COMMUNITY_ID, community_id)
149149
q.add_data(keys.CHANNEL_ID, channel_id)
150150
return q

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# required scope: none
1111
@query
1212
def get_top(limit=10, offset=0):
13-
q = Qry('games/top')
13+
q = Qry('games/top', use_token=False)
1414
q.add_param(keys.LIMIT, limit, 10)
1515
q.add_param(keys.OFFSET, offset, 0)
1616
return q
@@ -20,7 +20,7 @@ def get_top(limit=10, offset=0):
2020
# undocumented / unsupported
2121
@query
2222
def _check_follows(username, name):
23-
q = HQry('users/{username}/follows/games/isFollowing')
23+
q = HQry('users/{username}/follows/games/isFollowing', use_token=False)
2424
q.add_urlkw(keys.USERNAME, username)
2525
q.add_param(keys.NAME, name)
2626
return q
@@ -30,7 +30,7 @@ def _check_follows(username, name):
3030
# undocumented / unsupported
3131
@query
3232
def _get_followed(username, limit=25, offset=0):
33-
q = HQry('users/{username}/follows/games')
33+
q = HQry('users/{username}/follows/games', use_token=False)
3434
q.add_urlkw(keys.USERNAME, username)
3535
q.add_param(keys.LIMIT, limit, 25)
3636
q.add_param(keys.OFFSET, offset, 0)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
# required scope: none
99
@query
1010
def ingests():
11-
q = Qry('ingests')
11+
q = Qry('ingests', use_token=False)
1212
return q

0 commit comments

Comments
 (0)