fix: twitch oauth

This commit is contained in:
Strix 2025-04-10 02:36:17 +02:00
parent cdbb47f6b9
commit 842cdeb9b9

View file

@ -42,13 +42,14 @@ def get_token():
_token_cache["expires_at"] = time.time() + data["expires_in"]
return _token_cache["access_token"]
headers = {
'Client-ID': TWITCH_CLIENT_ID,
'Authorization': f'Bearer {get_token()}'
}
def update():
for channel in CHANNELS:
headers = {
'Client-ID': TWITCH_CLIENT_ID,
'Authorization': f'Bearer {get_token()}'
}
url = f'https://api.twitch.tv/helix/streams?user_login={channel}'
try:
response = requests.get(url, headers=headers)