2
2
# https://dev.twitch.tv/docs/v5/reference/clips/
3
3
4
4
from twitch import keys
5
- from twitch .api .parameters import Boolean , ClipPeriod , Cursor
5
+ from twitch .api .parameters import Boolean , ClipPeriod , Cursor , Language
6
6
from twitch .queries import V5Query as Qry
7
7
from twitch .queries import query
8
8
@@ -17,22 +17,25 @@ def by_slug(slug):
17
17
18
18
# required scope: None
19
19
@query
20
- def get_top (channels = None , games = None , period = ClipPeriod .WEEK , trending = Boolean .FALSE , cursor = 'MA==' , limit = 10 ):
20
+ def get_top (channels = None , games = None , period = ClipPeriod .WEEK , trending = Boolean .FALSE ,
21
+ language = Language .ALL , cursor = 'MA==' , limit = 10 ):
21
22
q = Qry ('clips/top' )
22
23
q .add_param (keys .CHANNEL , channels , None )
23
24
q .add_param (keys .GAME , games , None )
24
25
q .add_param (keys .PERIOD , ClipPeriod .validate (period ), ClipPeriod .WEEK )
25
26
q .add_param (keys .TRENDING , Boolean .validate (trending ), Boolean .FALSE )
27
+ q .add_param (keys .LANGUAGE , Language .validate (language ), Language .ALL )
26
28
q .add_param (keys .LIMIT , limit , 10 )
27
29
q .add_param (keys .CURSOR , Cursor .validate (cursor ), 'MA==' )
28
30
return q
29
31
30
32
31
33
# required scope: user_read
32
34
@query
33
- def get_followed (trending = Boolean .FALSE , cursor = 'MA==' , limit = 10 ):
35
+ def get_followed (trending = Boolean .FALSE , language = Language . ALL , cursor = 'MA==' , limit = 10 ):
34
36
q = Qry ('clips/followed' )
35
37
q .add_param (keys .TRENDING , Boolean .validate (trending ), Boolean .FALSE )
38
+ q .add_param (keys .LANGUAGE , Language .validate (language ), Language .ALL )
36
39
q .add_param (keys .LIMIT , limit , 10 )
37
40
q .add_param (keys .CURSOR , Cursor .validate (cursor ), 'MA==' )
38
41
return q
0 commit comments