Self-hosted downloader and player for YouTube, Bilibili, MissAV, and yt-dlp sites. Features channel subscriptions, auto-downloads, and local storage for media. Organize your library into collections with a sleek UI. Includes built-in Cloudflare Tunnel support for secure remote access without port forwarding. Docker-ready deployment.
π Try the live demo (read only): https://mytube-demo.vercel.app
- Video Downloading: Download YouTube, Bilibili and MissAV videos with a simple URL input.
- Video Upload: Upload local video files directly to your library with automatic thumbnail generation.
- Bilibili Support: Support for downloading single videos, multi-part videos, and entire collections/series.
- Parallel Downloads: Queue multiple downloads and track their progress simultaneously.
- Batch Download: Add multiple video URLs at once to the download queue.
- Concurrent Download Limit: Set a limit on the number of simultaneous downloads to manage bandwidth.
- Local Library: Automatically save video thumbnails and metadata for a rich browsing experience.
- Video Player: Custom player with Play/Pause, Loop, Seek, Full-screen, and Dimming controls.
- Auto Subtitles: Automatically download YouTube / Bilibili default language subtitles.
- Search: Search for videos locally in your library or online via YouTube.
- Collections: Organize videos into custom collections for easy access.
- Login Protection: Secure your application with password login and optional passkeys (WebAuthn).
- Internationalization: Support for multiple languages including English, Chinese, Spanish, French, German, Japanese, Korean, Arabic, Portuguese, and Russian.
- Pagination: Efficiently browse large libraries with pagination support.
- Subscriptions: Manage subscriptions to channels or creators to automatically download new content.
- Video Rating: Rate your videos with a 5-star system.
- Mobile Optimizations: Mobile-friendly tags menu and optimized layout for smaller screens.
- Temp Files Cleanup: Manage storage by cleaning up temporary download files directly from settings.
- View Modes: Toggle between Collection View and Video View on the home page.
- Cookie Management: Support for uploading
cookies.txtto enable downloading of age-restricted or premium content. - yt-dlp Configuration: Customize global
yt-dlparguments, network proxy, and other advanced settings via settings page. - Visitor User: Enable a read-only role for safe sharing without modification capabilities.
- Cloud Storage Integration: Automatically upload videos and thumbnails to cloud storage (OpenList/Alist) after download.
- Cloudflare Tunnel Integration: Built-in Cloudflare Tunnel support to easily expose your local MyTube instance to the internet without port forwarding.
- Task Hooks: Execute custom shell scripts at various stages of a download task (start, success, fail, cancel) for integration and automation. See Task Hooks Guide.
For a detailed breakdown of the project structure, please refer to Directory Structure.
For installation and setup instructions, please refer to Getting Started.
For a list of available API endpoints, please refer to API Endpoints.
- Runtime: Node.js with TypeScript
- Framework: Express.js
- Database: SQLite with Drizzle ORM
- Testing: Vitest
- Architecture: Layered architecture (Routes β Controllers β Services β Database)
- Framework: React 19 with TypeScript
- Build Tool: Vite
- UI Library: Material-UI (MUI)
- State Management: React Context API
- Routing: React Router v7
- HTTP Client: Axios with React Query
- Modular Storage Service: Split into focused modules for maintainability
- Downloader Pattern: Abstract base class for platform-specific implementations
- Database Migrations: Automatic schema updates using Drizzle Kit
- Download Queue Management: Concurrent downloads with queue support
- Video Download Tracking: Prevents duplicate downloads across sessions
The application uses environment variables for configuration.
VITE_API_URL=/api
VITE_BACKEND_URL=PORT=5551Data and uploads are stored under backend/data and backend/uploads by default (relative to the backend working directory).
Copy backend/.env.example to backend/.env and adjust as needed. The frontend ships with frontend/.env; use frontend/.env.local to override defaults.
MyTube uses SQLite with Drizzle ORM for data persistence. The database is automatically created and migrated on first startup:
- Location:
backend/data/mytube.db - Migrations: Automatically run on server startup
- Schema: Managed through Drizzle Kit migrations
- Legacy Support: Migration tools available to convert from JSON-based storage
Key database tables:
videos: Video metadata and file pathscollections: Video collections/playlistssubscriptions: Channel/creator subscriptionsdownloads: Active download queuedownload_history: Completed download historyvideo_downloads: Tracks downloaded videos to prevent duplicatessettings: Application configuration
We welcome contributions! Please see CONTRIBUTING.md for details on how to get started, our development workflow, and code quality guidelines.
For detailed instructions on how to deploy MyTube using Docker, please refer to Docker Deployment Guide.
-
Purpose and Restrictions This software (including code and documentation) is intended solely for personal learning, research, and technical exchange. It is strictly prohibited to use this software for any commercial purposes or for any illegal activities that violate local laws and regulations.
-
Liability The developer is unaware of and has no control over how users utilize this software. Any legal liabilities, disputes, or damages arising from the illegal or improper use of this software (including but not limited to copyright infringement) shall be borne solely by the user. The developer assumes no direct, indirect, or joint liability.
-
Modifications and Distribution This project is open-source. Any individual or organization modifying or forking this code must comply with the open-source license. Important: If a third party modifies the code to bypass or remove the original user authentication/security mechanisms and distributes such versions, the modifier/distributor bears full responsibility for any consequences. We strongly discourage bypassing or tampering with any security verification mechanisms.
-
Non-Profit Statement This is a completely free open-source project. The developer does not accept donations and has never published any donation pages. The software itself allows no charges and offers no paid services. Please be vigilant and beware of any scams or misleading information claiming to collect fees on behalf of this project.
MIT
