From be4ccc4bfc4c760608ced79d9f36ef2d59c23489 Mon Sep 17 00:00:00 2001 From: Twentysix Date: Fri, 8 Jan 2016 20:53:43 +0100 Subject: [PATCH] Hotfix for twitch alert system Streams were erroneously marked as inexistant in case of error. Most likely fixed. --- red.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/red.py b/red.py index 767c85ab6..621e59ace 100644 --- a/red.py +++ b/red.py @@ -1387,8 +1387,9 @@ async def twitchAlert(): try: url = "https://api.twitch.tv/kraken/streams/" + stream["NAME"] data = requests.get(url).json() - if "error" in data: #Stream doesn't exist, remove from list - to_delete.append(stream) + if "status" in data: + if data["status"] == 404: #Stream doesn't exist, remove from list + to_delete.append(stream) elif "stream" in data: if data["stream"] != None: if not stream["ALREADY_ONLINE"]: