Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

youtube-opendeck

Version: v0.1.0

YouTube Live stream control plugin for OpenDeck — manage your YouTube live stream directly from your deck. Send chat messages, view live viewers, run ad breaks, manage bans and moderators.

Features

Control 7 YouTube actions from your OpenDeck device:

  • Setup — Force a YouTube OAuth token refresh to verify authentication
  • Chat Message — Send a preset message to your YouTube live chat
  • Viewer Count — Display current live viewer count
  • Ad Break — Insert an ad break in your live broadcast
  • Ban User — Ban a user from your live chat
  • Unban User — Remove a ban from a user in your live chat
  • Add Moderator — Add a moderator to your live chat

Prerequisites

YouTube Data API v3 Access

To use this plugin, you need:

  1. Google Cloud Project with the YouTube Data API v3 enabled
  2. OAuth2 Credentials (Client ID and Client Secret)
  3. OpenDeck installed on your system

Supported Platforms

This plugin runs natively on:

  • Windows: x86_64
  • macOS: Intel x86_64, Apple Silicon ARM64
  • Linux: x86_64, ARM64

Installation

Option 1: Using Make (Recommended)

# Clone or download this repository
git clone https://github.com/PenguinzTech/youtube-opendeck.git
cd youtube-opendeck

# Install the plugin
make install

This copies the plugin to:

  • macOS/Linux: ~/.config/opendeck/plugins/dev.penguin.youtube.sdPlugin/
  • Windows: %APPDATA%\Elgato\StreamDeck\Plugins\dev.penguin.youtube.sdPlugin\

Option 2: Manual Installation

  1. Build the plugin (see "Building from Source" below)
  2. Locate your OpenDeck plugins directory:
    • macOS/Linux: ~/.config/opendeck/plugins/
    • Windows: %APPDATA%\Elgato\StreamDeck\Plugins\
  3. Copy the built plugin folder to the plugins directory
  4. Restart OpenDeck

Configuration

1. Set Up YouTube API Credentials

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the YouTube Data API v3:
    • Search for "YouTube Data API v3"
    • Click Enable
  4. Create OAuth2 credentials:
    • Go to CredentialsCreate CredentialsOAuth 2.0 Client ID
    • Choose Desktop application
    • Download the JSON credentials file
  5. Save your credentials securely

2. Install OpenDeck

Follow the OpenDeck installation guide for your operating system.

3. Add a YouTube Action to Your Deck

  1. Open OpenDeck
  2. Add any YouTube action to a button (Chat Message, Viewer Count, etc.)
  3. Click the Setup action to authenticate with your YouTube account
  4. Follow the OAuth2 authorization flow in your browser
  5. Grant the plugin access to your YouTube channel

Done

Your OpenDeck device is now authenticated with YouTube. Actions will execute immediately when pressed.

Building from Source

Prerequisites

  • Rust 1.70 or later
  • OpenDeck (installed)

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

Build and Install

git clone https://github.com/PenguinzTech/youtube-opendeck.git
cd youtube-opendeck

# Build and install the plugin
make install

# Or build only (creates release binary)
make build

# Or develop with live reload
make dev

The compiled binary will be available in the target/release/ directory.

Actions Reference

Action Description Configuration
Setup Force a YouTube OAuth token refresh to verify authentication None
Chat Message Send a preset message to your YouTube live chat Message text
Viewer Count Display current live viewer count None
Ad Break Insert an ad break in your live broadcast None
Ban User Ban a user from your live chat Username
Unban User Remove a ban from a user in your live chat Username
Add Moderator Add a moderator to your live chat Username

Important Notes

Permissions & Restrictions

  • Moderation Actions (Ban User, Unban User, Add Moderator) require you to be:

    • The channel owner/broadcaster, OR
    • A moderator in the channel
  • Ad Break requires:

    • Partner or YouTube Partner status on your channel
  • Chat Message works with any authentication but requires the channel to be live

  • Viewer Count works with any authentication but displays the live count only when streaming

Token Management

Tokens are automatically:

  • Persisted in OpenDeck's global settings
  • Refreshed before expiration
  • Validated on each button press

You can revoke access at any time from your Google Account Security Settings.

Troubleshooting

"Plugin not found" — Run make install again to ensure the plugin directory structure is correct.

"Setup failed" — Verify your Google Cloud OAuth2 credentials are correctly configured and the YouTube Data API v3 is enabled.

"Action failed: Not authorized" — Ensure you are a moderator in the channel or the channel broadcaster.

"Viewer count shows 0" — The channel may be offline. Viewer count only displays for live streams.

Development

Project Structure

youtube-opendeck/
├── src/
│   ├── main.rs              # Plugin entry point and message dispatcher
│   ├── auth.rs              # OAuth2 authentication implementation
│   ├── settings.rs          # OpenDeck property persistence
│   ├── youtube_api.rs       # YouTube Data API client
│   ├── global_handler.rs    # Global plugin state and initialization
│   └── actions/             # Individual action implementations
│       ├── chat_message.rs
│       ├── viewer_count.rs
│       ├── ad_break.rs
│       └── ... (other actions)
├── plugin/
│   ├── manifest.json        # Plugin metadata and configuration
│   ├── icon.png             # Plugin icon
│   └── actions/             # Action icons
├── Cargo.toml               # Rust dependencies
├── Makefile                 # Build and install targets
└── README.md                # This file

Running Tests

make test

License

This plugin is open source. See LICENSE file for details.

Support

For issues, feature requests, or contributions, visit the GitHub Issues page.

About

YouTube Live stream control plugin for OpenDeck — chat messages, viewer count, ad breaks, ban/unban users, add moderators

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages