| title | StreamBot |
|---|---|
| emoji | ๐ฌ |
| colorFrom | blue |
| colorTo | purple |
| sdk | docker |
| app_port | 3000 |
| suggested_hardware | cpu-basic |
| license | mit |
| short_description | Discord video streaming bot |
| pinned | false |
A powerful Discord self-bot for streaming videos from multiple sources with a web management interface
- โจ Features
- ๐ Requirements
- ๐ Installation
- ๐ฎ Usage
- ๐ณ Docker Setup
- ๐ฏ Commands
- โ๏ธ Configuration
- ๐ Web Interface
- ๐ค Contributing
โ ๏ธ Disclaimer- ๐ License
- ๐ Local Video Streaming: Stream videos from your local videos folder
- ๐ฌ YouTube Integration: Stream YouTube videos with smart search functionality
- ๐บ YouTube Live Streams: Direct streaming support for YouTube live content
- ๐ฃ Twitch Support: Stream Twitch live streams and video-on-demand (VODs)
- ๐ Direct URL Streaming: Stream from any URL supported by yt-dlp (thousands of video sites including Vimeo, Dailymotion, Facebook, Instagram, news sites, and more)
- ๐ต Queue System: Queue multiple videos with auto-play and skip functionality
- ๐ Web Management Interface: Full-featured web dashboard for video library management
- ๐ค Video Upload: Upload videos through the web interface or download from remote URLs
- ๐ผ๏ธ Video Previews: Generate and view thumbnail previews for all videos
- โ๏ธ Runtime Configuration: Adjust streaming parameters and bot settings during runtime
- Bun v1.1.39+ (recommended) or Node.js v21+
- FFmpeg (the bot will attempt to install it automatically if missing, but manual installation is recommended)
- yt-dlp (automatically downloaded and updated by the bot)
- ๐ฎ GPU with hardware acceleration for improved streaming performance
- ๐ High-speed internet for remote video streaming and downloads
- ๐พ Sufficient disk space for video storage and cache
This project is hosted on GitHub.
- Clone the repository:
git clone https://github.com/ysdragon/StreamBot
cd StreamBot- Install dependencies:
With Bun (recommended):
bun installWith npm:
npm install-
Configure environment:
- Copy
.env.exampleto.env - Update the configuration values (see โ๏ธ Configuration section)
- See the wiki for instructions on obtaining your Discord token
- Copy
-
Setup complete! ๐ Required directories for videos and cache will be created automatically on first run.
With Bun (recommended):
bun run startWith Node.js:
npm run build
npm run start:nodeWith web interface enabled:
Set SERVER_ENABLED=true in your .env file. The web interface runs alongside the bot automatically.
To run only the web interface without the bot:
bun run server # With Bun
npm run server:node # With Node.js (after building)All videos are played through a queue system that automatically advances to the next video when the current one ends.
The play command automatically detects the input type:
- ๐ Local files from your
VIDEOS_DIR - ๐ฌ YouTube videos (by URL or search query)
- ๐ฃ Twitch streams (live or VOD)
- ๐ Any URL supported by yt-dlp
Use ytsearch to find YouTube videos, then play with the results to stream them. Use list to browse your local video collection.
StreamBot provides ready-to-use Docker configurations for easy deployment.
- Create project directory:
mkdir streambot && cd streambot- Download Docker Compose configuration:
wget https://raw.githubusercontent.com/ysdragon/StreamBot/main/docker-compose.yml-
Configure environment:
- Edit
docker-compose.ymlto set your environment variables - Ensure video storage directories are properly mounted
- Edit
-
Launch StreamBot:
docker compose up -dFor enhanced network capabilities with Cloudflare WARP:
- Download WARP configuration:
wget https://raw.githubusercontent.com/ysdragon/StreamBot/main/docker-compose-warp.yml-
Configure WARP settings:
- Add your WARP license key to
docker-compose-warp.yml - Update Discord token and other required environment variables
- Add your WARP license key to
-
Launch with WARP:
docker compose -f docker-compose-warp.yml up -d
โ ๏ธ Note: The web interface is not available in WARP mode because the WARP container uses network isolation that prevents external access to the web server port.
| Command | Description | Aliases |
|---|---|---|
play <video_name|url|search_query> |
Play local video, URL, or search YouTube videos | |
ytsearch <query> |
Search for videos on YouTube | |
stop |
Stop current video playback and clear queue | leave, s |
skip |
Skip the currently playing video | next |
queue |
Display the current video queue | |
list |
Show available local videos |
| Command | Description | Aliases |
|---|---|---|
status |
Show current streaming status | |
preview <video_name> |
Generate preview thumbnails for a video | |
ping |
Check bot latency | |
help |
Show available commands |
| Command | Description | Aliases |
|---|---|---|
config [parameter] [value] |
View or adjust bot configuration parameters (Admin only) | cfg, set |
StreamBot is configured through environment variables in a .env file. Copy .env.example to .env and modify the values as needed.
# Required: Your Discord self-bot token
# See: https://github.com/ysdragon/StreamBot/wiki/Get-Discord-user-token
TOKEN="YOUR_BOT_TOKEN_HERE"
# Command prefix for bot commands
PREFIX="$"
# Discord server where the bot will operate
GUILD_ID="YOUR_SERVER_ID"
# Channel where bot will respond to commands
COMMAND_CHANNEL_ID="COMMAND_CHANNEL_ID"
# Voice/video channel where bot will stream
VIDEO_CHANNEL_ID="VIDEO_CHANNEL_ID"
# Admin user IDs - comma-separated or JSON array format
# Examples:
# ADMIN_IDS="123456789,987654321"
# ADMIN_IDS=["123456789","987654321"]
ADMIN_IDS=["YOUR_USER_ID_HERE"]
# Discord acknowledgement behavior
DISCORD_REACTIONS_ENABLED="" # Leave empty for profile default; set false if reactions time out
DISCORD_SEND_TIMEOUT_MS="" # Leave empty for 10000ms; nonzero values below 10000 are clamped; set 0 to wait forever
DISCORD_SUPPRESS_ABORT_WARNINGS="" # Leave empty to log Discord send aborts while debugging# Directory where video files are stored
VIDEOS_DIR="./videos"
# Directory for caching video preview thumbnails
PREVIEW_CACHE_DIR="./tmp/preview-cache"
# Directory for temporary remote movie cache files
STREAM_REMOTE_CACHE_DIR="./tmp/remote-cache"
# Directory for temporary pre-transcoded playback files
STREAM_TRANSCODE_CACHE_DIR="./tmp/transcode-cache"# Path to browser cookies for accessing private/premium content
# Supports: YouTube Premium, age-restricted content, private videos
YTDLP_COOKIES_PATH=""# Video Quality Settings
STREAM_PROFILE="" # Leave empty for auto; use "hf-cpu-basic" to force Hugging Face CPU Basic settings
STREAM_RESPECT_VIDEO_PARAMS="false" # Use original video parameters if true
STREAM_BITRATE_OVERRIDE="false" # If true, use STREAM_BITRATE_KBPS even when respecting video params
STREAM_WIDTH="1280" # Output resolution width
STREAM_HEIGHT="720" # Output resolution height
STREAM_MAX_WIDTH="0" # Max width cap (0 = disabled)
STREAM_MAX_HEIGHT="0" # Max height cap (0 = disabled)
STREAM_FPS="30" # Target frame rate
# Bitrate Settings (affects quality and bandwidth usage)
STREAM_BITRATE_KBPS="2000" # Target bitrate (higher = better quality)
STREAM_MAX_BITRATE_KBPS="2500" # Maximum allowed bitrate
# Performance & Encoding
STREAM_HARDWARE_ACCELERATION="false" # Use GPU acceleration if available
STREAM_VIDEO_CODEC="H264" # Codec: H264, H265, VP8, VP9, AV1
STREAM_FFMPEG_VIDEO_ENCODER="" # Optional FFmpeg encoder override, e.g. h264_nvenc
STREAM_FFMPEG_THREADS="0" # Optional FFmpeg thread limit (0 = auto)
STREAM_NO_TRANSCODING="false" # Skip video transcoding for already Discord-friendly sources
STREAM_PRETRANSCODE_BEFORE_PLAYBACK="false" # Pre-transcode before playback for smoother CPU-only VPS streaming
# Remote Source Cache
STREAM_FULL_CACHE_REMOTE="false" # Fully cache remote HTTP movies before playback
STREAM_REMOTE_PREBUFFER_MB="200" # Initial remote buffer size when full cache is disabled
# H.264/H.265 Encoding Preset (quality vs speed tradeoff)
# Options: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow
STREAM_H26X_PRESET="ultrafast"For Hugging Face CPU Basic Spaces, leave STREAM_PROFILE unset for auto-detection or set:
STREAM_PROFILE="hf-cpu-basic"That profile defaults to 854x480, 24 FPS, 1400-2000 Kbps, two FFmpeg threads, and full remote cache. Pre-transcoding before playback is opt-in because it can delay a full movie by many minutes before Discord receives any video.
# Enable/disable the web management interface
SERVER_ENABLED="false"
# Web interface authentication
SERVER_USERNAME="admin"
SERVER_PASSWORD="admin" # Plain text, bcrypt, or argon2 hash
# Web server port
SERVER_PORT="8080"To access private or premium content (like YouTube Premium videos), you can provide a cookies file:
-
Export cookies from your browser using a browser extension:
- Get cookies.txt LOCALLY (Chromium-based browsers)
- cookies.txt (Firefox-based browsers)
-
Save the cookies file (usually named
cookies.txt) to a location accessible by the bot -
Configure the path in your
.envfile:YTDLP_COOKIES_PATH="./cookies.txt"Or use the config command at runtime:
$config ytdlpCookiesPath ./cookies.txt -
Restart the bot if you updated the
.envfile
When enabled (SERVER_ENABLED="true"), StreamBot provides a web-based management interface.
- ๐ Video Library Management: Browse your video collection with file sizes and detailed information
- ๐ค Local File Upload: Upload videos directly with progress tracking
- ๐ Remote URL Download: Download videos from URLs directly to your library
- ๐ผ๏ธ Video Previews: Generate and view thumbnail screenshots from different parts of each video
- ๐๏ธ File Management: Delete videos from your library
- ๐ Video Metadata: View detailed information (duration, resolution, codec, etc.)
After enabling and restarting the bot, access the interface at http://localhost:8080 (or your configured SERVER_PORT).
Contributions are welcome! Feel free to:
- ๐ Report bugs via issues
- ๐ง Submit pull requests
- ๐ก Suggest new features
This bot may violate Discord's Terms of Service. Use at your own risk.
I disavow before Allah any unethical use of this project.
ุฅุจุฑุงุก ุงูุฐู ุฉ: ุฃุชุจุฑุฃ ู ู ุฃู ุงุณุชุฎุฏุงู ุบูุฑ ุฃุฎูุงูู ููุฐุง ุงูู ุดุฑูุน ุฃู ุงู ุงููู.
Licensed under MIT License. See LICENSE for details.