A high-performance Discord music bot written in Go with YouTube integration and age-restricted content bypass
- YouTube Integration - Play videos, playlists, and search with age-restricted content bypass
- High Performance - Go-based with 128kbps streaming and intelligent caching
- Queue Management - Move, shuffle, remove songs with 500-song capacity
- Pre-Download Buffer - 5-song lookahead for instant skipping
- Smart Caching - Metadata management with automatic cleanup and duplicate detection
- Comprehensive Controls - Skip, pause, resume, stop, and emergency reset
- History Tracking - Playback history with persistence
- Structured Logging - Professional logging with metrics collection
| Platform | Status | Notes |
|---|---|---|
| macOS | Fully Tested | Primary development platform |
| Linux | Experimental | May require additional configuration |
| Windows | Not Supported | Currently incompatible |
| Tool | Version | Purpose |
|---|---|---|
| Go | 1.23+ | Runtime environment |
| FFmpeg | Latest | Audio processing |
| yt-dlp | Latest | YouTube downloading |
macOS:
brew install go ffmpeg yt-dlpLinux (Ubuntu/Debian):
sudo apt update
sudo apt install golang-go ffmpeg -y
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod +x /usr/local/bin/yt-dlpBOT_TOKEN- Discord bot tokenYT_TOKEN- YouTube Data API v3 key
DEBUG- Enable debug logging (true/false)LOG_LEVEL- Logging level (DEBUG,INFO,WARN,ERROR)ENABLE_METRICS- Enable metrics collectionMAX_QUEUE_SIZE- Maximum queue size (default: 500)CACHE_DIR- Cache directory path (default: downloads)ENABLE_CACHING- Enable audio cachingENABLE_BUFFERING- Enable pre-download buffer
- Discord Bot: Create at Discord Developer Portal, get token from Bot section
- YouTube API: Enable YouTube Data API v3 in Google Cloud Console, create API key
- Set Environment Variables:
export BOT_TOKEN="your_discord_bot_token"
export YT_TOKEN="your_youtube_api_key"git clone https://github.com/Wolfenheimm/automuse.git
cd automuse
go mod download
export BOT_TOKEN="your_discord_bot_token"
export YT_TOKEN="your_youtube_api_key"
go build -o automuse
./automuseplay [URL/search]- Play YouTube video/playlist or searchskip [position]- Skip current song or to positionstop- Stop playback and clear queuepause/resume- Pause/resume playback
queue- Show current queueremove [number]- Remove song from queuemove [from] [to]- Move song between positionsshuffle- Shuffle queue
cache- Show cache statisticscache-clear- Clear old cached songsbuffer-status- Show buffer statushistory- Show playback historyemergency-reset- Reset all systems
YouTube URL → yt-dlp (age-restricted bypass) → MP3 Cache → FFmpeg → DCA → Discord
- Queue Manager - Thread-safe queue handling with 500-song capacity
- Buffer Manager - Pre-downloads next 5 songs for instant skipping
- Cache System - Metadata-driven storage with duplicate detection
- Age-Restricted Bypass - Multiple methods for accessing restricted content
- History Manager - Persistent playback history tracking
- Centralized configuration management with environment variable support
- Structured logging using zerolog with automatic rotation
- Dependency validation with health checks on startup
- Optional metrics collection for performance monitoring
- 128kbps Opus streaming with DCA encoding
- Configurable audio buffer (200 frames for memory safety)
- Multiple age-restricted bypass methods for comprehensive access
- Thread-safe operations with proper resource cleanup
- Download: 256kbps MP3, Stream: 128kbps Opus
- Buffer: 200 frames (~4 seconds) for memory safety
- Pre-download: 5 songs ahead for instant skipping
export MAX_QUEUE_SIZE="500"
export CACHE_DIR="downloads"
export ENABLE_CACHING="true"
export ENABLE_BUFFERING="true"
export ENABLE_METRICS="true"- Bot won't start: Check
BOT_TOKENandYT_TOKENenvironment variables - No audio: Verify FFmpeg installation (
ffmpeg -version) - Age-restricted videos fail: Update yt-dlp (
yt-dlp --update) - Performance issues: Check logs and adjust
MAX_QUEUE_SIZE - Dependencies: Bot validates dependencies on startup with detailed reports
MIT License - see LICENSE file for details.