Skip to content

Mouchoir/Streamerbot-Clips-BRB-screen

Repository files navigation

BRB Clip Player for Twitch Streams

This project provides an automated solution for displaying Twitch clips in your "Be Right Back" (BRB) scene using Streamer.bot, a Node.js server, Express and Puppeteer. It's based on the original BRB player concept by VRFlad, optimized for handling edited Twitch clips effectively.

Index

Introduction

This project is based on the BRB player by VRFlad and has been optimized to correctly display edited Twitch clips. It fetches all your Twitch clips and plays them in your BRB scene during breaks in your stream.

Streamer.bot will start the server on stream start and shut it down on stream end. For this reason, it is required that Streamer.bot is started before the stream.

  • If you started Streamer.bot after the stream or killed it before the end of the stream, you can easily turn on (BRB Init) and off (BRB Shutdown) the Node.js server by right-clicking the triggers and select "test trigger".

Installation

Prerequisites

Steps

  1. Create a project directory

    • On your computer, create a folder where all the files and Node.js modules will be placed.
    • This folder's path must be set to the WorkingDirectory variable in Streamer.bot
  2. Install Node.js, Express and Puppeteer:

    • Install Node.js from the official website.
    • Run npm install puppeteer in your project directory to install Puppeteer
    • Run npm install express in your project directory to install Express.
  3. Set Up the Project Directory:

    • Place the server.js script in your project folder.
    • Place the video_player.html script in your project folder.
    • The VideoPlayerHtml and JavascriptServer Streamerbot variables expect the respective .html and .js files to be located in the folder set up in the WorkingDirectory variable.
  4. Streamer.bot Code:

    • Import the provided Streamer.bot .sb file or copy and paste the code directly into Streamer.bot.

OBS Setup

  1. Create a Browser Source:

    • Set the browser source URL to about:blank. This will be the window where your Twitch clips are displayed.
  2. Create a Text GDI+ Source:

    • Optional: Use this source for displaying the clip's title and creator as credits.

Streamer.bot Setup

  1. Import the Script:
    • Import the provided .sb file or use the import code below to bring the setup into Streamer.bot.
    • Import code:
U0JBRR+LCAAAAAAABADtfVlz4tqW5ntH1H+gsx+6O+5VHo0g3Yh6MNhMtkkzCVDljY49CWQkxEUCDBX3v/faWxKThO10pc/JU1UngshjtLWHNXxrlPj3f/kfpdKXgMXoy99K/87/gD8XKGDw55ea7y2jUrVXLfXJirHFl7+mA9A6noUrPuQuWMa7p1X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ye4K2RI0rFmntOB1qi1WRR1DPO+ImoCbgaUQ9aXgGdDk8/4+6sL+6QvZma+H/NmL0Yv8Zj6keVyTY8WVPur/cD7k1XhcnSm00dtQnovP1k96741r+loUt4r86/VnlK/2eTq8/vfB/vdjjSLJ6SR1wbPY/KiLBXrx4Im8p0zH3A4DbfgPyWknPPFP+WBbb/bCvlHXfJ0e13o6k89ErYtnOe7vbB14tE2eO+G9p+973p7LAcdB1od7DjkQg+eVwgm3aWrnmfK+8qad9hYIHG3Z9V73RO/elx8Zz56dcTV7ruU5fb6Z57dCURNrinpy+kzcifxlz4EcnwfSH+YKrNuZOerlu4pSXyJ73jDN51/LA/G8HP/8efImbqXsUtmikqZB6KozU5EsVVElTVEIMU1ZpuUP/YjCnzNvkvxPNj5Jfbzxo7w/3LiJ/ZDw32l6LSfCkxzXNpX+Zu3VbSU/XZALFeUrxFqyVeDFMaPiPZY5ch0uH8l1OuuXR4hQVigO4dYrC3gf+nHdAyn+J16d9W6eCEqOfN5CJJ4KUlJBEkjJ55KQ/Cpr0SIrNmUvdy9L3yNeXEPLeL0q0jXxGyUFv9PxxZsuIGathvENIeFapJcut5QMEZHqAvkFA9If7qjx+9mqaPV0BOfcK6MIilifx7Sxtyk8xNQPMfJrYeiL9MR5AuXLWsx+uHZ2zENWDsSgdBDM8xFoEWe/o3FNpLcMR6AULP1VnzMpPF6s+R5bxOcXYy/IxvNv0h/XPv4CuJJs9wt7WYYrkGKekxTi+FX9mqpl/qe6k6sSZjH6Wgax/uf/B7nzbqinfAAA
  1. Configure Subactions variables: In Streamer.bot, go to the EmptyProfile BRB Config action and set up the following variables:
    • BRBBrowserSource: The name of your BRB browser source in OBS.
    • BRBScene: The name of your BRB scene in OBS.
    • ClipCreditsSource: The name of your text source for clip credits.
    • WorkingDirectory: The directory path where your project files are located.
    • NodeJsPath: The full path to your Node.js installation (node.exe).
    • VideoPlayerHtml: The name of your HTML video player file (video_player.html in this project).
    • JavascriptServer: The name of your JavaScript server file (server.js in this project).
    • NodeServerUrl: The URL for your Node.js server (default is localhost).
    • NodeServerPort: The port for your Node.js server (default is 3000).

Explanation of Changes

The solution has been modified to handle different types of Twitch clip URLs effectively, ensuring that the correct portion of the clip is played. This requires fetching the actual video URL with a token and other parameters using Puppeteer, bypassing the limitations of embedding directly through the browser. Additionally, a Node.js server is now launched in the background to handle clip processing more efficiently.

Types of Twitch Clip URLs

  1. Twitch Clip Page URL:

    • Example: https://clips.twitch.tv/IronicVivaciousMomTTours-s-p4PwURdCld4ilw
    • How to Obtain: This is the URL you get directly from Twitch when you clip a portion of a stream.
    • Problem: This URL leads to the full Twitch clip page, which includes the Twitch player and additional UI elements. It does not directly provide a way to embed only the edited portion of the video as a raw .mp4 file.
  2. Direct Media Asset URL:

    • Example: https://clips-media-assets2.twitch.tv/WPUMpbPqeD8FEXQpXeIpcA/40910109621-offset-9052.mp4
    • How to Obtain: This URL can sometimes be derived from inspecting the network requests made when the clip is played or using a guessed format based on other media assets.
    • Problem: The video obtained through this URL often includes the full unedited clip, which may not reflect the precise start and end points that the clip creator intended. This means you might get more content than you want if the clip was trimmed.
  3. Embedded Twitch Player URL:

    • Example: https://clips.twitch.tv/embed?clip=IronicVivaciousMomTTours-s-p4PwURdCld4ilw&parent=localhost
    • How to Obtain: This is a modified version of the Twitch Clip Page URL, designed for embedding in iframes.
    • Problem: This URL embeds the Twitch player within an iframe, which includes all Twitch branding and controls, not just the raw video. It does, however, correctly play only the edited portion of the clip.
  4. Direct Video File URL (via Network Inspection):

    • Example: https://production.assets.clips.twitchcdn.net/v2/media/IronicVivaciousMomTTours-s-p4PwURdCld4ilw/0e0ad629-8ef5-4bd5-a50e-b4c49f851801/video.mp4?sig={sig}8&token={token}
    • How to Obtain: This URL can be found by inspecting network requests in the browser when the clip is played in the Twitch player. The URL is usually tokenized, meaning it has a short expiration time.
    • Problem: The main issue here is that the URL contains a token and sig parameter that expires. Without these, the URL won’t work. Additionally, you need to manually inspect the network to get this URL, which isn't straightforward.

How It Works

  1. Streamer.bot: Launches the Node.js server on stream start and grabs a list of the user's clips. When the BRB is triggered (either by the !brb command or the OBS source change), Streamerbot sends an embedded clip URL to the server.
  2. Server Extracts the source video URL out of the embed video URL and returns it to Streamer.bot.
  3. Streamer.bot: Sets the OBS scene containing the player to the correct URL.
  4. Player: Plays whatever video is specified after the "?" in its URL.
  5. Streamer.bot: Shuts down the server on stream end.

Additionally, a "credit" option is included to easily display the title and author of the clip. The script also ensures that the same clip isn't played twice until all clips have been broadcasted.

Commands

  • !brb: Switches to your BRB scene and starts rolling clips (command available to mods by default).
  • Manually changing your OBS source to your BRB scene will also trigger the script.
  • Start stream trigger: Starts the Node.js server.
  • Stop stream trigger: Stops the Node.js server.

About

Automate the display of your clips in your stream !

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors