How alexta69/metube works
MeTube is a self-hosted web interface for submitting media URLs and downloading video, audio, subtitles, and related content through yt-dlp. The main workflow runs from the browser UI through the backend API into download processing, with queue/status updates returned to the UI. Separate subscription management periodically discovers new channel or playlist items and queues them. Persistent state and URL safety are important supporting layers. Some backend wiring is unsampled, so uncertain relationships are omitted rather than inferred from imports alone.
Main entry points: ytdl.py Download engine · app.ts Main UI · subscriptions.py Subscription manager · main.py HTTP API
Components 18
Browser UI
- Main UI
ui/src/app/app.ts - Download service
ui/src/app/services/downloads.service.ts - Socket client
ui/src/app/services/metube-socket.service.ts - Batch URL tools
ui/src/app/services/batch-urls.service.ts - Subscription service
ui/src/app/services/subscriptions.service.ts - Notifications
ui/src/app/services/toast.service.ts
Download backend
- HTTP API
app/main.py - Download engine
app/ytdl.py - Format selection
app/dl_formats.py - Music metadata
app/music_metadata.py - Persistent queue
app/ytdl.py
Subscriptions
- Subscription manager
app/subscriptions.py
State and safety
- State store
app/state_store.py - URL safety
app/url_guard.py - Background tasks
app/bg_tasks.py
Other components
- User
- Media sites
- Download files
Connections 21
- User → Main UI: submits URLs
README.md - Main UI → Download service: adds downloads
ui/src/app/app.ts - Main UI → Subscription service: manages subscriptions
ui/src/app/app.ts - Main UI → Batch URL tools: exports URLs
ui/src/app/services/batch-urls.service.ts - Download service → Socket client: receives events
ui/src/app/services/downloads.service.ts - Subscription service → Socket client: receives events
ui/src/app/services/subscriptions.service.ts - Main UI → Notifications: shows notices
ui/src/app/app.ts - Download service → HTTP API: posts requests
- Subscription service → HTTP API: posts requests
- HTTP API → Subscription manager: checks subscriptions
app/main.py - HTTP API → Download engine: dispatches downloads
app/main.py - Subscription manager → Persistent queue: queues new items
app/subscriptions.py - Subscription manager → State store: persists records
app/subscriptions.py - Subscription manager → Background tasks: starts periodic loop
app/subscriptions.py - Subscription manager → Media sites: checks channels
- Download engine → Media sites: extracts media
README.md - Download engine → Format selection: selects format
app/ytdl.py - Download engine → Download files: writes downloads
README.md - Download engine → URL safety: validates URLs
app/ytdl.py - Download engine → Music metadata: processes audio tags
app/ytdl.py - Download engine → Persistent queue: tracks work
app/ytdl.py