I’'m trying to check which streams are online or not from a list of following channels but what I have right now is very slow. It has to load the json object from every stream link which slows it down by alot.
item = requests.get("https://api.twitch.tv/kraken/users/test_channel/follows/channels? oauth_token=_______________________________") loadSource = json.loads(item.text) for item in loadSource["follows"]: checkOnline = requests.get("https://api.twitch.tv/kraken/streams/" + item["channel"]["name"]) loadSource = json.loads(checkOnline.text) if loadSource["stream"] != None: print item["channel"]["name"]
I’m getting the right list of online streams but requesting a site for every stream makes it very slow. Is there a way I can request if a list of streams at once.