- ๐ Local Video Streaming: Stream videos from your local videos folder
- ๐ฌ YouTube Integration: Stream YouTube videos
- ๐ 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
- Bun
v1.1.39+
(recommended) or Node.jsv21+
- FFmpeg (in PATH or working directory)
- yt-dlp (automatically downloaded/updated by the bot)
This project is hosted on GitHub.
- Clone the repository:
git clone https://github.com/ysdragon/StreamBot
- Install dependencies:
bun install
- Configure environment:
- Rename
.env.example
to.env
- Update configuration values
- Rename
With Bun (recommended):
bun run start
With Node.js:
bun run build
bun run start:node
Note: All videos are played through a queue system. Use the
play
command to add videos to the queue, and they will be played sequentially with automatic advancement to the next video.
StreamBot supports multiple video sources:
- Local Videos: Store videos in your
VIDEOS_DIR
folder and useplay <filename>
- Smart Play: Use
play <input>
for automatic detection and streaming (local file, YouTube video, Twitch stream, or any URL supported by yt-dlp) - YouTube Search: Use
ytsearch <query>
to search YouTube and display results (useplay
with search results to stream) - Live Streams: Full support for YouTube Live streams and Twitch live content
- Video Queue: All playback goes through a queue system - videos are added to queue and played sequentially
- Create a directory and navigate to it:
mkdir streambot && cd streambot
- Download the compose file:
wget https://raw.githubusercontent.com/ysdragon/StreamBot/main/docker-compose.yml
-
Configure environment variables in
docker-compose.yml
-
Launch container:
docker compose up -d
- Download WARP compose file:
wget https://raw.githubusercontent.com/ysdragon/StreamBot/main/docker-compose-warp.yml
-
Configure
docker-compose-warp.yml
:- Add your WARP license key
- Update TOKEN, etc
-
Launch with WARP:
docker compose -f docker-compose-warp.yml up -d
Note
The basic video server will not work if you use WARP.
Command | Description | Aliases |
---|---|---|
play <input> |
Smart play: local video, URL, or YouTube search | |
ytsearch <query> |
Search YouTube and display results | |
stop |
Stop current playback | leave , s |
skip |
Skip to next video in queue | next |
queue |
Display current video queue | |
list |
Show local video library | |
status |
Show playback status | |
preview <video> |
Generate video thumbnails | |
ping |
Check bot latency | |
help |
Show available commands |
Configuration is done via .env
file:
# Selfbot options
TOKEN = "" # Your Discord self-bot token
PREFIX = "$" # The prefix used to trigger your self-bot commands
GUILD_ID = "" # The ID of the Discord server your self-bot will be running on
COMMAND_CHANNEL_ID = "" # The ID of the Discord channel where your self-bot will respond to commands
VIDEO_CHANNEL_ID = "" # The ID of the Discord voice/video channel where your self-bot will stream videos
# General options
VIDEOS_DIR = "./videos" # The local path where you store video files
PREVIEW_CACHE_DIR = "./tmp/preview-cache" # The local path where your self-bot will cache video preview thumbnails
# Stream options
STREAM_RESPECT_VIDEO_PARAMS = "false" # Respect original video parameters (width, height, fps, bitrate)
STREAM_WIDTH = "1280" # The width of the video stream in pixels
STREAM_HEIGHT = "720" # The height of the video stream in pixels
STREAM_FPS = "30" # The frames per second (FPS) of the video stream
STREAM_BITRATE_KBPS = "1000" # The bitrate of the video stream in kilobits per second (Kbps)
STREAM_MAX_BITRATE_KBPS = "2500" # The maximum bitrate of the video stream in kilobits per second (Kbps)
STREAM_HARDWARE_ACCELERATION = "false" # Enable hardware acceleration for video decoding
STREAM_VIDEO_CODEC = "H264" # Video codec: VP8, H264, H265, VP9, or AV1
# H.26x encoding preset for optimal quality/speed balance
# Available presets: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow
STREAM_H26X_PRESET = "ultrafast"
# Videos server options
SERVER_ENABLED = "false" # Enable the built-in web server for video management
SERVER_USERNAME = "admin" # Username for the web interface
SERVER_PASSWORD = "admin" # Password for the web interface (bcrypt hash is supported)
SERVER_PORT = "8080" # Port number for the web server
Check the Get token wiki
When enabled by setting SERVER_ENABLED=true
in your .env
file, StreamBot provides a user-friendly web-based management interface for seamless video library control.
Features:
- ๐ Video Library Management: Browse, search, and organize your video collection
- ๐ค Video Upload: Upload new videos directly through the web interface
- ๐ผ๏ธ Thumbnail Generation: Automatic preview generation for all videos in the library
Access: Available at http://localhost:SERVER_PORT
when enabled
Setup:
- Set
SERVER_ENABLED=true
in your.env
file - Configure
SERVER_USERNAME
,SERVER_PASSWORD
, andSERVER_PORT
- Restart the bot to apply changes
- Access the web interface in your browser at the configured port
Contributions are welcome! Feel free to:
- ๐ Report bugs via issues
- ๐ง Submit pull requests
- ๐ก Suggest new features
This bot may violate Discord's ToS. Use at your own risk.
ุฃุชุจุฑุฃ ู ู ุฃู ุงุณุชุฎุฏุงู ุบูุฑ ุฃุฎูุงูู ููุฐุง ุงูู ุดุฑูุน ุฃู ุงู ุงููู.
Licensed under MIT License. See LICENSE for details.