Skip to content
Stream controller for the site
JavaScript HTML
Branch: master
Clone or download
IAmThermite Changes to reflect api update
A fix for gapi undefined error
Latest commit 7b52cc7 Sep 20, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Update browser page to work from a cold boot. Aug 20, 2019
LICENSE Initial commit Aug 19, 2019 Add !cancel and !queue, fix bug with !clip Sep 16, 2019
config_default.js Update how the stream gets clips Sep 11, 2019
index.js Fixed a bunch of things that broke Sep 12, 2019
obs.js Bump back to 720 Sep 17, 2019
package-lock.json Made twitch bot use api Sep 11, 2019
twitch.js Changes to reflect api update Sep 20, 2019 Stream Controller


Here is the code for the stream controller. It handles automatically starting the stream and handles errors in the clips. It handles the Twitch bot as well.

The index.html file is served up by the express server and is used in a Browser Source in OBS (url localhost:3000).

The Twitch bot

Commands are as follows: (text in square braces is optional)

  • !skip -> skips the current clip and plays the next one, requires 20% of viewers (mod/broadcaster can override)
  • !report [previous] -> flags the current clip or the previous clip, requires 20% of viewers (!report previous) and skips if necessary (mod/broadcaster can override)
  • !help/!commands -> shows the available commands
  • !upload -> shows location to upload clips
  • !clip [previous] -> gets current clip information
  • !queue -> shows the next 3 clips in the queue
  • !vote [url] -> vote for a clip to be played next, requires 2 other approvals (mod/broadcaster can override)

Mod commands:

  • !restartClip -> restarts the browser source in OBS
  • !randomise [restart?] -> randomise order of clips, if restart is true it will reload the browser, effectively skipping the current clip
  • !cancel -> cancels all vote/skip/report actions in progress. Also good for resetting them if it bugs out

Broadcaster commands:

  • !endStream -> ends the stream (node process is kept alive)
  • !startStream - > starts the stream

Known Bugs

Sometimes it decides to randomly error out the first video on start. This is an issue with the YouTube API sometimes loading in late and throwing an error when the clip info is being retrieved. Should be a pretty simple fix however, but will keep looking into it.

You can’t perform that action at this time.