I am also having the same issue, but what the script is not the issue, but the JSON parsing.
For some reason that I haven't been able to find out yet, json.mrc is not able to parse the response from twitch api anymore