Skip to content

ByteTrix/selftube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SelfTube

A self-hosted web application for downloading videos and photos from various social media platforms including Instagram, YouTube, TikTok, Twitter, and more. Features a modern dark theme UI with an intuitive interface.


by bytetrix

✨ Features

  • 🎬 Multi-platform support: Instagram, YouTube, TikTok, Twitter, Facebook, and 1000+ more
  • πŸŽ›οΈ Quality selection: Choose from 360p to 4K (2160p)
  • πŸ“± Format options: MP4, WebM, MKV, and best available
  • 🎡 Audio extraction: Download audio-only versions
  • πŸ“Š Batch processing: Handle multiple downloads
  • πŸ”’ Self-hosted: Complete control over your data
  • 🌐 Modern UI: Clean, dark-themed responsive design with sidebar navigation
  • πŸ“ˆ Progress tracking: Real-time download status with visual feedback
  • πŸ—‚οΈ File management: Organize and manage downloads with cleanup options
  • πŸ›‘οΈ Security: Rate limiting and input validation
  • πŸ“‹ Clipboard integration: Quick paste functionality
  • 🎯 One-click actions: Auto, Audio, Info, and Paste buttons

🎨 UI Features

  • Modern Dark Theme: Deep black backgrounds with accent colors (yellow, purple, red)
  • Sidebar Navigation: Collapsible sidebar with Save, Settings, Donate, Updates, and About
  • Animated Mascot: Custom cat mascot with smooth animations
  • Responsive Design: Mobile-first approach with hamburger menu
  • Action Buttons:
    • 🟑 Auto - Standard download
    • 🟣 Audio - Audio-only download
    • πŸ”΄ Info - Get media information
    • βšͺ Paste - Paste from clipboard
  • Toast Notifications: Real-time feedback for all actions
  • Loading States: Smooth overlays and progress indicators

πŸš€ Quick Start

Prerequisites

  • Node.js: Version 16 or higher
  • pnpm: Package manager (install via npm install -g pnpm)
  • Python: Required for yt-dlp (auto-installed in Docker)
  • FFmpeg: For video processing (optional but recommended)

Installation

  1. Clone or download this project

  2. Install dependencies:

    pnpm install
  3. Run setup script:

    pnpm run setup
  4. Start the development server:

    # Start backend
    pnpm --filter server dev
    
    # In another terminal, start frontend
    pnpm --filter client dev
  5. Open your browser: http://localhost:5173

Using Docker

  1. Using Docker Compose (recommended):

    docker-compose up -d
  2. Or using Docker directly:

    docker build -t selftube .
    docker run -p 3000:3000 -v ./downloads:/app/downloads selftube

How to Use

  1. Paste a URL from any supported platform
  2. Click "Get Info" to see video details (optional)
  3. Select quality and format preferences
  4. Click "Download" to start the process
  5. Monitor progress in the download status section
  6. Access files from the downloads list

Supported Platforms

  • YouTube: Videos, shorts, playlists
  • Instagram: Posts, reels, stories, IGTV
  • TikTok: Videos and compilations
  • Twitter/X: Videos and GIFs
  • Facebook: Videos and posts
  • And 1000+ more sites supported by yt-dlp

Configuration

Environment Variables

Create a .env file (copy from .env.example):

PORT=3000
NODE_ENV=production
ALLOWED_ORIGINS=http://localhost:3000
LOG_LEVEL=info
RATE_LIMIT_POINTS=10
RATE_LIMIT_DURATION=60

Advanced Configuration

Edit config/default.json for:

  • Download timeouts and retries
  • Allowed formats and qualities
  • Cleanup schedules
  • Security settings

API Endpoints

Download Video

POST /api/download
{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID",
  "quality": "720p",
  "format": "mp4",
  "audioOnly": false
}

Get Video Information

POST /api/info
{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID"
}

Check System Health

GET /api/health

File Structure

selftube/
β”œβ”€β”€ downloads/          # Downloaded media files
β”œβ”€β”€ logs/              # Application logs
β”œβ”€β”€ config/            # Configuration files
β”œβ”€β”€ server/            # Backend code
β”œβ”€β”€ public/            # Frontend assets
└── scripts/           # Setup and utility scripts

Security Features

  • Rate limiting to prevent abuse
  • Input validation and sanitization
  • Path traversal protection
  • CORS configuration
  • Security headers via Helmet.js

Deployment

Production Mode

NODE_ENV=production npm start

Systemd Service (Linux)

sudo cp selftube.service /etc/systemd/system/
sudo systemctl enable selftube
sudo systemctl start selftube

Reverse Proxy (Nginx)

server {
    listen 80;
    server_name yourdomain.com;
    
    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Troubleshooting

Common Issues

  1. yt-dlp not found: Auto-downloads on first use
  2. Permission errors: Check directory permissions
  3. Network issues: Verify firewall and connectivity

Health Check

Visit /api/health to check system status and dependencies.

Logs

Check the logs/ directory:

  • combined.log: All application logs
  • error.log: Error messages only

Development

# Install dependencies
npm install

# Start in development mode
npm run dev

# View logs
tail -f logs/combined.log

License

MIT License - Use freely for personal and commercial projects.

Disclaimer

⚠️ Important: This tool is for personal use only. Respect copyright laws and platform terms of service. The developers are not responsible for any misuse of this software.

Support

  • Report issues on GitHub
  • Check documentation in the wiki
  • Join community discussions

Powered by yt-dlp - The ultimate media extraction library

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published