Find and open a Twitch stream.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This script will find and open the best available Twitch stream. It will first check any streams that you specify as "priority" streams, then any streams that you follow. If none of those are available, it will open the top stream for the game you specify.

I'm using it, along with an RTC wake-up and at, as a sort of alarm clock (see how).


  1. Install livestreamer, a command-line utility that will pipe Twitch streams into your video player.
  2. Adjust the file as you like.
    • Choose your priority channels. These will be checked in your order of preference as ["firstchoice", "secondchoice"] and so on.
    • Choose the game you would prefer to watch. If none of your priority channels or followed channels are available, the top stream for this game will be opened.
    • Choose the quality of the stream you'd prefer. I'd suggest picking "best" if you can support high-quality video, and "worst" if you cannot. There are other options such as "high", "low", "medium", and "mobile", but they may not always be available depending on the streamer's configuration.
  3. If you are running Linux and would like to set the system volume before opening the stream, check if you have amixer available (you can do this by typing amixer -v in a bash shell and seeing if it gives you a version number). If so, uncomment this line in
  4. Run
  5. If you have not run the script before, you will be taken to a Twitch webpage to authorize the application. Click "Authorize", then copy the OAuth token it provides into the command prompt.