How varghq/social-media-video-downloader works
This Bun CLI and TypeScript library turns video URLs into local media files: the CLI validates and dispatches commands, the download layer parses platform identity and builds yt-dlp work, and the yt-dlp runner resolves and executes the external binary while streaming progress and results. It also supports metadata-only lookup, audio/playlist/quality/cookie options, binary updates, and optional varg uploads. Arrows reflect calls shown in excerpts or README; broader yt-dlp site coverage is documented, not implemented as per-site code here.
Main entry points: download.ts Download and metadata · cli.ts Command interface · index.ts Library exports · ytdlp.ts yt-dlp process runner
Components 13
Entry points
- Command interface
src/cli.ts - Library exports
src/index.ts
Download workflow
- URL and platform parsing
src/platforms.ts - Download and metadata
src/download.ts
Runtime integrations
- yt-dlp process runner
src/ytdlp.ts - yt-dlp executable
Optional upload
- Varg upload client
src/varg.ts
Other components
- CLI user
- Library caller
- Video sites
- Downloaded media
- ffmpeg
- varg file API
Connections 21
- CLI user → Command interface: runs commands
README.md - Library caller → Library exports: calls exports
README.md - Command interface → Download and metadata: requests download
src/cli.ts - Command interface → Download and metadata: requests metadata
src/cli.ts - Command interface → URL and platform parsing: detects platform
src/cli.ts - Command interface → Varg upload client: uploads files
src/cli.ts - Command interface → yt-dlp process runner: updates binary
src/cli.ts - Library exports → Download and metadata: exports functions
src/index.ts - Library exports → URL and platform parsing: exports helpers
src/index.ts - Library exports → Varg upload client: exports uploader
src/index.ts - Library exports → yt-dlp process runner: exports runtime
src/index.ts - Download and metadata → URL and platform parsing: parses URLs
src/download.ts - Download and metadata → yt-dlp process runner: runs arguments
src/download.ts - yt-dlp process runner → yt-dlp executable: spawns process
src/ytdlp.ts - yt-dlp executable → Video sites: extracts media
README.md - yt-dlp executable → Downloaded media: writes downloads
README.md - Download and metadata → Downloaded media: returns file paths
src/download.ts - yt-dlp process runner → ffmpeg: configures location
src/ytdlp.ts - Download and metadata → ffmpeg: checks availability
src/download.ts - Varg upload client → Downloaded media: reads file
src/varg.ts - Varg upload client → varg file API: posts file
src/varg.ts