Skip to content

Commit 8539f1f

Browse files
authored
Merge pull request #14 from anxdpanic/dev
update undocumented endpoints, add undocumented videos endpoint
2 parents 1a0a097 + 015aff0 commit 8539f1f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def get_top(limit=10, offset=0):
1919
# required scope: none
2020
# undocumented / unsupported
2121
@query
22-
def check_follows(username, name):
22+
def _check_follows(username, name):
2323
q = HQry('users/{username}/follows/games/isFollowing')
2424
q.add_urlkw(keys.USERNAME, username)
2525
q.add_param(keys.NAME, name)
@@ -29,7 +29,7 @@ def check_follows(username, name):
2929
# required scope: none
3030
# undocumented / unsupported
3131
@query
32-
def get_followed(username):
32+
def _get_followed(username):
3333
q = HQry('users/{username}/follows/games')
3434
q.add_urlkw(keys.USERNAME, username)
3535
return q
@@ -38,7 +38,7 @@ def get_followed(username):
3838
# required scope: user_follows_edit
3939
# undocumented / unsupported
4040
@query
41-
def follow(username, name):
41+
def _follow(username, name):
4242
q = HQry('users/{username}/follows/games/follow', method=methods.PUT)
4343
q.add_urlkw(keys.USERNAME, username)
4444
q.add_data(keys.NAME, name)
@@ -48,7 +48,7 @@ def follow(username, name):
4848
# required scope: user_follows_edit
4949
# undocumented / unsupported
5050
@query
51-
def unfollow(username, name):
51+
def _unfollow(username, name):
5252
q = HQry('users/{username}/follows/games/unfollow', method=methods.DELETE)
5353
q.add_urlkw(keys.USERNAME, username)
5454
q.add_data(keys.NAME, name)

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from twitch import keys
55
from twitch.api.parameters import BroadcastType, Period
66
from twitch.queries import V5Query as Qry
7+
from twitch.queries import HiddenApiQuery as HQry
78
from twitch.queries import query
89

910

@@ -35,3 +36,12 @@ def get_followed(limit=10, offset=0, broadcast_type=BroadcastType.HIGHLIGHT):
3536
q.add_param(keys.OFFSET, offset, 0)
3637
q.add_param(keys.BROADCAST_TYPE, BroadcastType.validate(broadcast_type))
3738
return q
39+
40+
41+
# required scope: none
42+
# undocumented / unsupported
43+
@query
44+
def _by_id(video_id):
45+
q = HQry('videos/{video_id}')
46+
q.add_urlkw(keys.VIDEO_ID, video_id)
47+
return q

0 commit comments

Comments
 (0)