Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.module.python.twitch" name="python-twitch for Kodi" version="2.0.9" provider-name="A Talented Community">
<addon id="script.module.python.twitch" name="python-twitch for Kodi" version="2.0.10" provider-name="A Talented Community">
<requires>
<import addon="xbmc.python" version="2.20.0"/>
<import addon="script.module.six" version="1.11.0"/>
Expand All @@ -9,9 +9,7 @@
<extension point="xbmc.addon.metadata">
<platform>all</platform>
<news>
[upd] allow overriding headers for usher and hidden api calls
[fix] decode byte responses in scraper
[fix] usher/parser error handling
[upd] allow overriding headers for all hidden api calls
</news>
<assets>
<icon>icon.png</icon>
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.0.10
[upd] allow overriding headers for all hidden api calls

2.0.9
[upd] allow overriding headers for usher and hidden api calls
[fix] decode byte responses in scraper
Expand Down
16 changes: 8 additions & 8 deletions resources/lib/twitch/api/v5/games.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def get_top(limit=10, offset=0):
# required scope: none
# undocumented / unsupported
@query
def _check_follows(username, name):
q = HQry('users/{username}/follows/games/isFollowing', use_token=False)
def _check_follows(username, name, headers={}):
q = HQry('users/{username}/follows/games/isFollowing', headers=headers, use_token=False)
q.add_urlkw(keys.USERNAME, username)
q.add_param(keys.NAME, name)
return q
Expand All @@ -38,8 +38,8 @@ def _check_follows(username, name):
# required scope: none
# undocumented / unsupported
@query
def _get_followed(username, limit=25, offset=0):
q = HQry('users/{username}/follows/games', use_token=False)
def _get_followed(username, limit=25, offset=0, headers={}):
q = HQry('users/{username}/follows/games', headers=headers, use_token=False)
q.add_urlkw(keys.USERNAME, username)
q.add_param(keys.LIMIT, limit, 25)
q.add_param(keys.OFFSET, offset, 0)
Expand All @@ -49,8 +49,8 @@ def _get_followed(username, limit=25, offset=0):
# required scope: user_follows_edit
# undocumented / unsupported
@query
def _follow(username, name):
q = HQry('users/{username}/follows/games/follow', method=methods.PUT)
def _follow(username, name, headers={}):
q = HQry('users/{username}/follows/games/follow', headers=headers, method=methods.PUT)
q.add_urlkw(keys.USERNAME, username)
q.add_data(keys.NAME, name)
return q
Expand All @@ -59,8 +59,8 @@ def _follow(username, name):
# required scope: user_follows_edit
# undocumented / unsupported
@query
def _unfollow(username, name):
q = HQry('users/{username}/follows/games/unfollow', method=methods.DELETE)
def _unfollow(username, name, headers={}):
q = HQry('users/{username}/follows/games/unfollow', headers=headers, method=methods.DELETE)
q.add_urlkw(keys.USERNAME, username)
q.add_data(keys.NAME, name)
return q
4 changes: 2 additions & 2 deletions resources/lib/twitch/api/v5/videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def complete_upload(video_id, upload_token):
# required scope: none
# undocumented / unsupported
@query
def _by_id(video_id):
q = HQry('videos/{video_id}', use_token=False)
def _by_id(video_id, headers={}):
q = HQry('videos/{video_id}', headers=headers, use_token=False)
q.add_urlkw(keys.VIDEO_ID, video_id)
return q