1
0
Fork 0
mirror of synced 2024-06-12 07:34:33 +12:00

Added the url to the logging method, based on twitch saying not client id is specified

This commit is contained in:
phxntxm 2016-09-21 14:11:21 -05:00
parent e2001f9aba
commit 911eb41459

View file

@ -105,11 +105,13 @@ class Twitch:
url = result['twitch_url']
user = re.search("(?<=twitch.tv/)(.*)", url).group(1)
twitch_url = "https://api.twitch.tv/kraken/channels/{}?client_id={}".format(user, self.key)
with aiohttp.ClientSession() as s:
async with s.get("https://api.twitch.tv/kraken/channels/{}?client_id={}".format(user, self.key)) as r:
async with s.get(twitch_url) as r:
data = await r.json()
with open("twitch_testing", 'w') as f:
json.dump(data, f)
print("URL was: {}".format(twitch_url), file=f)
fmt = "Username: {}".format(data['display_name'])
fmt += "\nStatus: {}".format(data['status'])