**v**ideo **s**tream **d**ownloader is a command line program to download video streams served over HTTP from websites, [HLS](https://howvideo.works/#hls) and [DASH](https://howvideo.works/#dash) playlists.
## Features
- [x] Capturing network requests and collecting .m3u8, .mpd and subtitles from websites and save them locally.
- [x] Muxing streams to single video container using ffmpeg.
- [x] Singular progress bar for complete download process like an normal file download with realtime file size estimations.
- [x] Supports `AES-128` and `CENC` playlists decryption.
- [x] Supports HLS and DASH
- [x] Supports downloading in multiple threads.
- [ ] GUI (maybe in future)
- [ ] Supports [SAMPLE-AES](https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption/Encryption/Encryption.html) playlist decryption.
- [ ] Live stream download (wip)
See More
## Installation
Dependencies
- [ffmpeg](https://www.ffmpeg.org/download.html) (optional, *recommended*) only required for transmuxing and transcoding streams.
- [chrome](https://www.google.com/chrome) / [chromium](https://www.chromium.org/getting-involved/download-chromium/) (optional) only required for `capture` and `collect` subcommands.
Visit [releases](https://github.com/clitic/vsd/releases) for prebuilt binaries. Download and extract archive and then copy vsd binary to any path. Now add that path to your `PATH` environment variable.
| Host | Architecture | Download |
|---------------------|--------------|--------------------------------------------------------------------------------------------------------------|
| Android 7+ (Termux) | aarch64 | [.tar.xz](https://github.com/clitic/vsd/releases/download/0.3.2/vsd-0.3.2-aarch64-linux-android.tar.xz) |
| Linux | aarch64 | [.tar.xz](https://github.com/clitic/vsd/releases/download/0.3.2/vsd-0.3.2-aarch64-unknown-linux-musl.tar.xz) |
| MacOS 11.7+ | aarch64 | [.tar.xz](https://github.com/clitic/vsd/releases/download/0.3.2/vsd-0.3.2-aarch64-apple-darwin.tar.xz) |
| Windows | aarch64 | [.zip](https://github.com/clitic/vsd/releases/download/0.3.2/vsd-0.3.2-aarch64-pc-windows-msvc.zip) |
| Linux | x86_64 | [.tar.xz](https://github.com/clitic/vsd/releases/download/0.3.2/vsd-0.3.2-x86_64-unknown-linux-musl.tar.xz) |
| MacOS 11.7+ | x86_64 | [.tar.xz](https://github.com/clitic/vsd/releases/download/0.3.2/vsd-0.3.2-x86_64-apple-darwin.tar.xz) |
| Windows | x86_64 | [.zip](https://github.com/clitic/vsd/releases/download/0.3.2/vsd-0.3.2-x86_64-pc-windows-msvc.zip) |
You can also install vsd through cargo by using this command.
```bash
cargo install vsd
```
Build instructions can be found [here](https://github.com/clitic/vsd/blob/main/vsd/BUILD.md) and changelog [here](https://github.com/clitic/vsd/blob/main/vsd/CHANGELOG.md).
Additionally, you can also install third party [gui](https://github.com/theRealCataclysm/VSD-GUI) frontend created by [theRealCataclysm](https://github.com/theRealCataclysm).
## Usage
- Downloading and saving HLS and DASH playlists to disk.
```bash
$ vsd save -o video.mp4
```
> For testing purposes you can use streams from [https://test-streams.mux.dev](https://test-streams.mux.dev).
- Collecting .m3u8 (HLS), .mpd (Dash) and subtitles from a website and saving them locally.
```bash
$ vsd capture --save
```
## Help
```bash
$ vsd --help
```
```
Download video streams served over HTTP from websites, DASH (.mpd) and HLS (.m3u8) playlists.
Usage: vsd.exe [OPTIONS]
Commands:
capture Capture playlists and subtitles from a website
extract Extract subtitles from mp4 boxes
merge Merge multiple segments to a single file
save Download DASH and HLS playlists
help Print this message or the help of the given subcommand(s)
Options:
--color When to output colored text [default: auto] [possible values: auto, always, never]
-h, --help Print help
-V, --version Print version
```
```bash
$ vsd save --help
```
```
Download DASH and HLS playlists
Usage: vsd.exe save [OPTIONS]
Arguments:
http(s):// | .mpd | .xml | .m3u8
Options:
--base-url Base url to be used for building absolute url to segment. This flag is usually needed for local input files. By default redirected
playlist url is used
-d, --directory Change directory path for temporarily downloaded files. By default current working directory is used
-o, --output