YouTube

Youtube Extension

Contents

Outgoing channel : "YOUTUBE"

Description

This extension allows youtube integration into chat

Features

Currently the extension only receives youtube messages from your current live stream.

Settings

Settings Small (for mainpage quick links)

  • enable/disable addon
  • youtube channel to scan
    • This is the channel the extension will scan for live videos
  • cookie authentication
    • Enter your yourube cookie here to be able to post into live chat from streamroller
  • restore defaults
    • Resets the extension data to defaults/remove creadentials/cookies.

Settings Large (for main settings full page)

none

Authorization

Authorization is done via youtube cookies from your normal login when browsing youtube.

To get hold of a cookie to use in StreamRoller perform the following steps.

  • In a browser, sign into YouTube (either incognito or a browser you don't use for YouTube), then hit F12/ctrl-shift-i/right-click-menu to bring up the Developer Tools/Inspector.
  • Choose the Network tab.
  • Select XHR filter.
  • Enter 'browse' in the Filter box.
  • Now scroll down the YouTube web page until an entry starting with 'browse' appears. Select it.
  • Scroll down in the Headers tab until you see Cookie under Request Headers.
  • Right-click on the value of Cookie and select Copy Value (or select all and right click-copy). note: the cookies are large multiline section blocks. More detailed description with pictures

Triggers/Actions

Triggers and actions below are updated when the automatic document generation system is run and only contain triggers actions relating to this specific extension.

Table last updated: Wed, 12 Mar 2025 05:38:02 GMT

Triggers

name trigger description
Youtube message received trigger_ChatMessageReceived A chat message was received. textMessage field has name and message combined

Actions

name trigger description
YouTube post livechat message action_youtubePostLiveChatMessage Post to youtube live chat if we are connected.

"YouTube" Extension Details...

YouTube functionality without the google API limits (limited free Tokens) or need for complicated OAUTH for the users requiring a google cloud account with a valid application setup to get the ClientId and ClientSecret needed.
Source:

Methods

MonitorForLiveStream()

Monitor for a stream going live on our channel
Source:

SaveConfigToServer()

Saves the configuration to the server
Source:

SendSettingsWidgetSmall(toExtensionnullable)

Processes and send out our small settings widget
Parameters:
Name Type Attributes Description
toExtension string <nullable>
optional extension name to send to other wise broadcast the message
Source:

chatEnd()

Called on chat end/stream end
Source:

chatError(error)

Called when a chatError occurs
Parameters:
Name Type Description
error object
Source:

chatMessage(action)

Called when a chat message is received
Parameters:
Name Type Description
action object
Source:

chatStart(initial_data)

Called when YouTube connection starts
Parameters:
Name Type Description
initial_data object
Source:

connectToAPI()

Connects and starts monitoring YouTube chat
Source:

deleteCredentials()

delete the credentials file on the server
Source:

findTriggerByMessageType(messagetype) → {object}

Finds a trigger from the messagetype
Parameters:
Name Type Description
messagetype string
Source:
Returns:
trigger
Type
object

heartBeatCallback()

Provides a heartbeat message to inform other extensions of our status
Source:

initialise(app, host, port, heartbeat)

Starts the extension using the given data.
Parameters:
Name Type Description
app Express
host String
port Number
heartbeat Number
Source:

metaUpdate(metadata)

Called when the metadata is updated for the stream
Parameters:
Name Type Description
metadata object
Source:

onDataCenterConnect(socket)

Called when connection to StreamRoller server starts
Parameters:
Name Type Description
socket object
Source:

onDataCenterDisconnect(reason)

Called when connection to StreamRoller server disconnects
Parameters:
Name Type Description
reason string
Source:

onDataCenterMessage(server_packet)

Called when a message is received from StreamRoller
Parameters:
Name Type Description
server_packet object
Source:

postLiveChatMessages(data)

TBD: Send a message to youtube chat TBD
Parameters:
Name Type Description
data object
Source:

postTrigger(data)

Posts a trigger out on our channel
Parameters:
Name Type Description
data object
Source:

sanitiseHTML(string) → {string}

Removes html chars from a string to avoid chat message html injection
Parameters:
Name Type Description
string string
Source:
Returns:
the parsed string
Type
string

saveCredentialsToServer()

Source:

sendChatMessageTrigger(ytmessage, time)

Processes a chat message and sends out the trigger "trigger_ChatMessageReceived"
Parameters:
Name Type Description
ytmessage object
time string
Source:

sendLiveChatPaidMessage(ytmessage, time)

Processes a Paid chat messages message
Parameters:
Name Type Description
ytmessage object
time string
Source:

sendLiveChatPaidSticker(ytmessage, time)

Processes a Paid chat sticker message
Parameters:
Name Type Description
ytmessage object
time string
Source:

startYoutubeMonitor()

Start the Monitor
Source:

stopYoutubeMonitor()

Stop monitoring YouTube chat
Source: