fix: twitch oauth
This commit is contained in:
parent
cdbb47f6b9
commit
842cdeb9b9
1 changed files with 5 additions and 4 deletions
|
@ -42,13 +42,14 @@ def get_token():
|
|||
_token_cache["expires_at"] = time.time() + data["expires_in"]
|
||||
return _token_cache["access_token"]
|
||||
|
||||
|
||||
|
||||
def update():
|
||||
for channel in CHANNELS:
|
||||
headers = {
|
||||
'Client-ID': TWITCH_CLIENT_ID,
|
||||
'Authorization': f'Bearer {get_token()}'
|
||||
}
|
||||
|
||||
def update():
|
||||
for channel in CHANNELS:
|
||||
url = f'https://api.twitch.tv/helix/streams?user_login={channel}'
|
||||
try:
|
||||
response = requests.get(url, headers=headers)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue