Skip to content

A lightweight bot that monitors YouTube channels and sends rich notifications to Discord.

License

Notifications You must be signed in to change notification settings

richardthornton/echotube

Repository files navigation

EchoTube πŸŽ¬πŸ“Ί

Ko-fi Buy Me A Coffee

EchoTube is a lightweight, self-hosted bot that monitors YouTube channels or playlists for new videos containing specific keywords and posts ultra-clean notifications to Discord via webhooks.

Built with modern Node.js 20+ features, zero external dependencies (except RSS parser), and production-ready security.

Docker Hub GitHub release License: MIT


✨ Features

  • 🎯 Smart YouTube Monitoring - RSS-based channel and playlist tracking
  • πŸ” Flexible Keyword Matching - Case-insensitive "any" or "all" matching modes
  • 🎨 Ultra-Clean Discord Embeds - Minimal design with large thumbnails (1280x720)
  • 🌐 Multi-Server Support - Post to multiple Discord servers simultaneously
  • πŸ› οΈ Zero Configuration Complexity - Pure environment variable setup
  • πŸ“¦ Single Docker Container - Production-ready with security hardening
  • 🧠 Intelligent Caching - Prevents duplicates with timestamp-based recovery
  • πŸ§ͺ Comprehensive Test Mode - Safe validation without posting to Discord
  • πŸ“Š Production Logging - Structured JSON logs with configurable levels
  • πŸš€ Smart Initial Run - Won't spam Discord on first startup

πŸš€ Quick Start

Step 1: Test Your Setup (Recommended First Step!)

# This is completely safe - it won't post anything to Discord
docker run --rm \
  -e ET_TEST_MODE=true \
  -e ET_CHANNEL_IDS=UCexample1 \
  -e ET_KEYWORDS=minecraft,gaming \
  -e ET_LOG_LEVEL=DEBUG \
  richardthornton/echotube:latest

Step 2: Get Your Configuration Ready

You'll need:

  • πŸ”— Discord Webhook URL(s) - Create one here (can use multiple for different servers)
  • πŸ“Ί YouTube Channel IDs - Found in URLs (format: UCxxxxxxxxxxxxxxxxxx)
  • πŸ” Keywords - What words to look for in video titles

Step 3: Run EchoTube

Option A: Docker Run (Simple)

docker run -d \
  --name=echotube \
  -e ET_CHANNEL_IDS=UCexample1,UCexample2 \
  -e ET_KEYWORDS=minecraft,gaming,tutorial \
  -e ET_DISCORD_WEBHOOK_URLS=https://discord.com/api/webhooks/... \
  -v ./cache:/app/cache \
  richardthornton/echotube:latest

Option B: Docker Compose (Recommended)

# Get the template files
curl -O https://raw.githubusercontent.com/richardthornton/echotube/main/docker-compose.yml
curl -O https://raw.githubusercontent.com/richardthornton/echotube/main/.env.example

# Set up your configuration
cp .env.example .env
# Edit .env with your settings

# Start EchoTube
docker-compose up -d

βš™οΈ Configuration

Required Environment Variables

Variable Description Example
ET_DISCORD_WEBHOOK_URLS Discord webhook URLs - comma-separated for multiple servers (How to create) https://discord.com/api/webhooks/... or https://discord.com/api/webhooks/url1,https://discord.com/api/webhooks/url2
ET_KEYWORDS Comma-separated search terms minecraft,gaming,tutorial

Content Sources (at least one required)

Variable Description Example
ET_CHANNEL_IDS Comma-separated YouTube channel IDs UCexample1,UCexample2
ET_PLAYLIST_IDS Comma-separated YouTube playlist IDs PLexample1,PLexample2

Optional Configuration

Variable Default Description
ET_MATCH_TYPE any any (match any keyword) or all (match all keywords)
ET_POLL_INTERVAL_SECONDS 300 Poll frequency in seconds (minimum: 60)
ET_LOG_LEVEL INFO Log level: DEBUG, INFO, WARN, ERROR
ET_CACHE_FILE memory-only Path for persistent video cache
ET_TEST_MODE false Set to true to test without posting to Discord
ET_DEVELOPMENT_MODE false Set to true to post only one video per source

🎨 Discord Embed Preview

EchoTube creates beautiful, minimal Discord notifications featuring:

  • Channel Name - Clickable link to the YouTube channel
  • Video Title - Clickable link to the YouTube video
  • Large Thumbnail - High-resolution video preview (1280x720)
  • YouTube Red Color - Clean, recognizable branding

What's NOT included: dates, footers, source info, or any clutter - just pure video content.


πŸ“‹ Getting YouTube Channel/Playlist IDs

Channel IDs (format: UCxxxxxxxxxxxxxxxxxx)

  1. Go to the YouTube channel
  2. Look at the URL: youtube.com/channel/UCexample or youtube.com/c/channelname
  3. If URL shows /c/channelname, view page source and search for "channelId":"UC

Playlist IDs (format: PLxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)

  1. Go to the YouTube playlist
  2. Look at the URL: youtube.com/playlist?list=PLexample
  3. Copy everything after list=

πŸ§ͺ Example Use Cases

  • Gaming Communities: Monitor favorite streamers and post to multiple Discord servers
  • Educational Content: Track programming tutorials and share across learning communities
  • Content Curation: Automatically share relevant videos in multiple community Discord servers
  • Development Updates: Get notified about software releases in both team and public servers
  • Entertainment: Follow content creators and cross-post to different interest-based servers

⚠️ Important Notes

  • RSS Feed Limitation: YouTube RSS feeds only show the 25 most recent videos
  • Title-Only Matching: Only matches video titles (descriptions/tags not available via RSS)
  • Public Content Only: No access to private playlists or unlisted content
  • Duplicate Prevention: Monitoring both channels AND their playlists may cause duplicate notifications
  • Rate Limiting: Discord webhooks are rate-limited to prevent spam

πŸ”§ Advanced Usage

Test Mode

Perfect for validating your configuration:

ET_TEST_MODE=true docker-compose up echotube-test

Development Mode

Posts only one video per source for testing:

ET_DEVELOPMENT_MODE=true docker-compose up echotube-dev

Custom Build

Build from source for development:

git clone https://github.com/richardthornton/echotube.git
cd echotube
docker build -t echotube:custom .

πŸ› Need Help?

Something not working? Here's how to troubleshoot:

  1. Always test first: Use ET_TEST_MODE=true to validate your setup safely
  2. Check the basics: Verify your Discord webhook URLs are active and YouTube channel IDs are correct
  3. Look at logs: Run docker logs echotube to see what's happening (logs show webhook-specific success/failures)
  4. Common issues: Keywords are case-insensitive, RSS feeds only show 25 recent videos, and invalid webhook URLs will cause posting failures

Still stuck? Open an issue and we'll help you out!


πŸ’– Support This Project

If EchoTube saves you time and makes your Discord server better, consider buying me a coffee! Your support helps keep this project maintained and improves it for everyone.

Ko-fi Buy Me A Coffee

Every contribution, no matter how small, helps maintain and improve EchoTube for the community. Thank you! πŸ™


🀝 Contributing

Want to make EchoTube even better? We'd love your help!

  1. Fork the repository
  2. Create a feature branch
  3. Make your improvements
  4. Test with ET_TEST_MODE=true
  5. Submit a pull request

See our Contributing Guide for more details.


πŸ“‹ Installation Options

Docker Hub (Recommended)

docker pull richardthornton/echotube:latest

GitHub Container Registry

docker pull ghcr.io/richardthornton/echotube:latest  

From Source

git clone https://github.com/richardthornton/echotube.git
cd echotube && npm install && npm start

πŸ“„ License

MIT License Β© Richard Thornton - Use it however you want!


Made with ❀️ by Richard Thornton

EchoTube: Clean YouTube notifications for Discord, the way they should be. ✨

About

A lightweight bot that monitors YouTube channels and sends rich notifications to Discord.

Resources

License

Contributing

Stars

Watchers

Forks

Packages