YTV is a command-line tool to stream and download YouTube videos and playlists directly from your terminal.
Before using YTV, you need to have the following tools installed on your system:
- yt-dlp: A youtube-dl fork with additional features and fixes.
- mpv: A free, open source, and cross-platform media player.
- Install the CLI tool using
go install:go install github.com/Shivgitcode/ytv@latest
- Ensure your Go bin directory is in your system's PATH. This is usually
~/go/binon Linux/macOS or%USERPROFILE%\go\binon Windows. If it's not already in your PATH, you can add it by modifying your shell's configuration file (e.g.,.bashrc,.zshrc,.profile):After adding, remember to source your configuration file (e.g.,export PATH=$PATH:$(go env GOPATH)/bin
source ~/.bashrc) or restart your terminal.
Now you can run ytv from any directory.
YTV provides three main commands: stream, download, and playlist.
To stream a YouTube video, use the stream command followed by the video URL.
ytv stream <video-url>You can also choose the playback speed using the --speed flag.
ytv stream --speed <video-url>This will prompt you to select a playback speed from the available options.
To download a YouTube video, use the download command followed by the video URL.
ytv download <video-url>By default, the video will be downloaded in the best available quality. You can choose a specific quality using the --quality flag.
ytv download --quality <video-url>This will prompt you to select a quality from the available options (360p, 480p, 720p, 1080p). The downloaded video will be saved in your Downloads folder.
To download a YouTube playlist, use the playlist command followed by the playlist URL.
ytv playlist <playlist-url>The videos in the playlist will be downloaded to a folder with the playlist's title inside your Downloads folder.
--speed: (stream) Prompts for playback speed selection.--quality: (download) Prompts for video quality selection.