How franciscorsantos/dtube works
dTube lets a user enter a YouTube URL, inspect video metadata and available formats, then request an MP4 video or MP3 audio download and save the streamed file locally with progress feedback. The browser UI calls a FastAPI backend: routes validate and shape requests, while the YouTube service uses yt-dlp for extraction and temporary-file downloads; the response schedules cleanup after delivery. The README also documents adjustable API configuration, cookies, and FFmpeg support. Frontend request and streaming behavior and backend service wiring are source-backed; broader UI details are based on README claims.
Main entry points: routes.py API endpoints · app.js UI controller · youtube_service.py YouTube service · index.html Downloader UI
Components 14
Browser interface
- Downloader UI
frontend/index.html - UI controller
frontend/app.js - API configuration
frontend/config.js - Local save target
REST API
- FastAPI app
backend/app/main.py - API endpoints
backend/app/api/routes.py - Request and response models
backend/app/api/schemas.py
Media processing
- YouTube service
backend/app/services/youtube_service.py - Validation and cleanup
backend/app/utils/helpers.py - Temporary media files
backend/app/services/youtube_service.py
Other components
- User
- yt-dlp
- YouTube
- FFmpeg
Connections 18
- User → Downloader UI: uses
- Downloader UI → UI controller: drives
- UI controller → API configuration: reads settings
- UI controller → API endpoints: requests metadata or download
- API endpoints → Request and response models: validates and shapes
- API endpoints → YouTube service: requests processing
- YouTube service → Validation and cleanup: validates URLs and formats duration
- YouTube service → yt-dlp: extracts or downloads
- yt-dlp → YouTube: fetches media data
- YouTube service → Temporary media files: writes download
- YouTube service → FFmpeg: converts audio
- API endpoints → Temporary media files: serves file
- API endpoints → Validation and cleanup: schedules cleanup
- API endpoints → UI controller: returns metadata or streams file
- UI controller → Downloader UI: updates details and progress
- UI controller → Local save target: writes downloaded file
- User → Local save target: chooses save destination
- Validation and cleanup → Temporary media files: removes after delivery