Created
December 2, 2015 05:08
-
-
Save jtg567/2fb7b801095cd264d2eb to your computer and use it in GitHub Desktop.
Use the twitch.tv API with python to see if a particular channel is streaming (python-twitch)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twitch.api.v3 import streams | |
# check stream w/twitch api https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel | |
check = streams.by_channel('<replace channel name>') | |
# if stream None (not live) then type == dict is False (otherwise True when live) | |
air_status = type(check['stream']) == dict |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment