Fixed error for inexistent beam.pro streams

Apparently beam.pro is too lazy to use json when inexistent streams are
requested
This commit is contained in:
Twentysix 2016-03-18 01:28:29 +01:00
parent 5c3f321d19
commit 659164e158

View File

@ -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