From 659164e15883a29821b3dad96c372743c3301595 Mon Sep 17 00:00:00 2001 From: Twentysix Date: Fri, 18 Mar 2016 01:28:29 +0100 Subject: [PATCH] Fixed error for inexistent beam.pro streams Apparently beam.pro is too lazy to use json when inexistent streams are requested --- cogs/streams.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/streams.py b/cogs/streams.py index b77504121..81edcac03 100644 --- a/cogs/streams.py +++ b/cogs/streams.py @@ -254,9 +254,9 @@ class Streams: async def beam_online(self, stream): url = "https://beam.pro/api/v1/channels/" + stream - async with aiohttp.get(url) as r: - data = await r.json() try: + async with aiohttp.get(url) as r: + data = await r.json() if "online" in data: if data["online"] == True: return True