Commit 020a442 1 parent 6d08ac0 commit 020a442 Copy full SHA for 020a442
File tree 3 files changed +7
-6
lines changed
3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ def acquire_token(self):
51
51
"client_id" : TWITCH_CLIENT_ID ,
52
52
"state" : state ,
53
53
"redirect_uri" : TWITCH_AUTH_REDIRECT_URI ,
54
- "scope" : TWITCH_AUTH_SCOPES ,
54
+ "scope" : " " . join ( TWITCH_AUTH_SCOPES ) ,
55
55
}
56
56
url_parts [4 ] = urlencode (query )
57
57
url = urlunparse (url_parts )
Original file line number Diff line number Diff line change 7
7
TWITCH_API_URL = "https://api.twitch.tv/helix/"
8
8
TWITCH_AUTH_URL = "https://id.twitch.tv/oauth2/authorize"
9
9
TWITCH_AUTH_REDIRECT_URI = "twitch-indicator-auth://authorize"
10
- TWITCH_AUTH_SCOPES = "user:read:email"
10
+ TWITCH_AUTH_SCOPES = [ "user:read:follows" ]
11
11
TWITCH_CLIENT_ID = "lp42a3ot0vosrva84upd4up077f6vd"
12
12
TWITCH_API_LIMIT = 100
13
13
DEFAULT_AVATAR = (
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ def clear_cache(self):
28
28
29
29
def fetch_followed_channels (self , user_id ):
30
30
"""Fetch user followed channels and return a list with channel ids."""
31
- url = self .build_url ("users/follows" , {"from_id" : user_id })
31
+ loc = "channels/followed"
32
+ url = self .build_url (loc , {"user_id" : user_id })
32
33
resp = self .get_api_response (url )
33
34
34
35
total = int (resp ["total" ])
@@ -42,16 +43,16 @@ def fetch_followed_channels(self, user_id):
42
43
last = resp
43
44
while fetched < total :
44
45
url = self .build_url (
45
- "users/follows" ,
46
- {"after" : last ["pagination" ]["cursor" ], "from_id " : user_id },
46
+ loc ,
47
+ {"after" : last ["pagination" ]["cursor" ], "user_id " : user_id },
47
48
)
48
49
nxt = self .get_api_response (url )
49
50
50
51
fetched += len (nxt ["data" ])
51
52
data += nxt ["data" ]
52
53
last = nxt
53
54
54
- return [{"id" : int (data ["to_id " ]), "name" : data ["to_name " ]} for data in data ]
55
+ return [{"id" : int (data ["broadcaster_id " ]), "name" : data ["broadcaster_name " ]} for data in data ]
55
56
56
57
def fetch_live_streams (self , channel_ids ):
57
58
"""Fetches live streams data from Twitch, and returns as list of
You can’t perform that action at this time.
0 commit comments