Added the url to the logging method, based on twitch saying not client id is specified
This commit is contained in:
parent
e2001f9aba
commit
911eb41459
1 changed files with 3 additions and 1 deletions
|
@ -105,11 +105,13 @@ class Twitch:
|
||||||
|
|
||||||
url = result['twitch_url']
|
url = result['twitch_url']
|
||||||
user = re.search("(?<=twitch.tv/)(.*)", url).group(1)
|
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:
|
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()
|
data = await r.json()
|
||||||
with open("twitch_testing", 'w') as f:
|
with open("twitch_testing", 'w') as f:
|
||||||
json.dump(data, f)
|
json.dump(data, f)
|
||||||
|
print("URL was: {}".format(twitch_url), file=f)
|
||||||
|
|
||||||
fmt = "Username: {}".format(data['display_name'])
|
fmt = "Username: {}".format(data['display_name'])
|
||||||
fmt += "\nStatus: {}".format(data['status'])
|
fmt += "\nStatus: {}".format(data['status'])
|
||||||
|
|
Loading…
Reference in a new issue