From acc86d08db9f6da6e2f950e3ac9e20c9ec4b0d00 Mon Sep 17 00:00:00 2001 From: Chovin Date: Sun, 26 Feb 2017 14:14:12 +1000 Subject: [PATCH] [Streams] Fetch APIs with utf-8 encoding (#642) --- cogs/streams.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cogs/streams.py b/cogs/streams.py index 95b2dfa6f..797cb3edf 100644 --- a/cogs/streams.py +++ b/cogs/streams.py @@ -316,7 +316,7 @@ class Streams: url = "https://api.hitbox.tv/media/live/" + stream try: async with aiohttp.get(url) as r: - data = await r.json() + data = await r.json(encoding='utf-8') if "livestream" not in data: return None if data["livestream"][0]["media_is_live"] == "0": @@ -334,7 +334,7 @@ class Streams: header = {'Client-ID': self.settings.get("TWITCH_TOKEN", "")} try: async with session.get(url, headers=header) as r: - data = await r.json() + data = await r.json(encoding='utf-8') await session.close() if r.status == 400: return 400 @@ -353,7 +353,7 @@ class Streams: url = "https://beam.pro/api/v1/channels/" + stream try: async with aiohttp.get(url) as r: - data = await r.json() + data = await r.json(encoding='utf-8') if "online" in data: if data["online"] is True: data = self.beam_embed(data)