A simple and efficient command-line tool for downloading media from various platforms. Currently supports YouTube with plans for additional platforms.
- �️ Interactive Format Selection: Choose one or more formats to download via an interactive prompt
- 📊 Parallel Downloads: Selected formats are downloaded simultaneously, each with its own progress bar
- 🏠 Organized Storage: Automatically saves downloads to
~/mget-downloads - 🔗 Multiple URL Formats: Supports various YouTube URL formats (youtube.com, youtu.be, m.youtube.com, Shorts, Embed)
- Go 1.26 or later
git clone https://github.com/renato3x/mget.git
cd mget
go build -o mget ./cmd/mgetInstall directly from GitHub:
go install github.com/renato3x/mget/cmd/mget@latestOr install from a local clone:
go install ./cmd/mgetMake sure your $GOPATH/bin or $GOBIN is in your $PATH.
Provide a URL and follow the interactive prompt to select the formats you want to download:
mget https://www.youtube.com/watch?v=VIDEO_IDmget versionThe tool accepts various YouTube URL formats:
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://m.youtube.com/watch?v=VIDEO_IDhttps://www.youtube.com/shorts/VIDEO_IDhttps://www.youtube.com/embed/VIDEO_IDhttps://www.youtube.com/v/VIDEO_ID
The project is organized into several packages:
cmd/mget: Main entry pointinternal/cli: Command-line interface built withcobra, including the root command and subcommandsinternal/downloader: Core download logic, provider interface, and platform-specific implementations
- URL Validation: The tool validates the provided URL
- Platform Detection: Matches the URL against registered providers (currently YouTube)
- Format Listing: Fetches all available formats with audio channels for the requested media
- Interactive Selection: Presents a multi-select prompt so you can pick one or more formats to download
- Parallel Download: Streams all selected formats concurrently, each with its own progress bar
- File Storage: Saves each file to
~/mget-downloadswith a slugified name derived from the format tag, MIME type, and media title
- Supports audio-only and audio+video formats
- Lists all available formats with audio channels for selection
- Uses the
kkdai/youtube/v2library for YouTube API interaction
All downloads are saved to:
~/mget-downloads/
Files are named using a slug built from the format's itag number, MIME type, and the media title (e.g., 137-video-mp4-rick-astley-never-gonna-give-you-up.mp4). The directory is automatically created if it doesn't exist.
$ mget https://www.youtube.com/watch?v=dQw4w9WgXcQ
Rick Astley - Never Gonna Give You Up - 3m33s
? Select one or more options for download [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
> [ ] [137] 1080p (MP4)
[ ] [248] 1080p (WEBM)
[ ] [140] Audio (MP4)
...$ mget version
0.4.0The tool provides clear error messages for common issues:
- Invalid or missing URL
- Unsupported platform
- Network errors
- Format selection failures
- File system errors
github.com/kkdai/youtube/v2: YouTube video downloadinggithub.com/AlecAivazis/survey/v2: Interactive multi-select promptgithub.com/vbauerster/mpb/v8: Multi-bar concurrent progress displaygithub.com/spf13/cobra: CLI framework
See LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.