npmytd
v1.1.2
Published
A CLI tool to download YouTube videos or audio.
Maintainers
Readme
███╗ ██╗██████╗ ███╗ ███╗██╗ ██╗████████╗██████╗ ████╗ ██║██╔══██╗████╗ ████║╚██╗ ██╔╝╚══██╔══╝██╔══██╗ ██╔██╗ ██║██████╔╝██╔████╔██║ ╚████╔╝ ██║ ██║ ██║ ██║╚██╗██║██╔═══╝ ██║╚██╔╝██║ ╚██╔╝ ██║ ██║ ██║ ██║ ╚████║██║ ██║ ╚═╝ ██║ ██║ ██║ ██████╔╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝
A simple and interactive command-line interface (CLI) tool for downloading YouTube videos and audio (MP3 or MP4) in various qualities.
Features
- Interactive Prompts: Guides you through the download process.
- MP4 Video Download: Download videos in your desired quality.
- MP3 Audio Download: Extract and convert audio to MP3 format.
- Quality Selection: Choose between highest, medium, or lowest quality.
- Progress Indicator: See the download progress in real-time.
- Output Path Customization: Specify where to save your downloads.
Prerequisites
Before installing and using npmytd, ensure you have the following installed on your system:
- Node.js: Version 18 or higher. You can download it from nodejs.org.
- ffmpeg: Required for MP3 audio conversion. If you only plan to download MP4 videos,
ffmpegis not strictly necessary.- You can download
ffmpegfrom ffmpeg.org/download.html. - After downloading, make sure
ffmpegis added to your system'sPATHenvironment variable so thatnpmytdcan find it.
- You can download
Installation
To install npmytd globally, open your terminal or command prompt and run:
npm install -g npmytdThis will make the npmytd command available system-wide.
Usage
To start a download, simply run the npmytd command in your terminal:
npmytdThe CLI will then guide you through a series of prompts:
- YouTube video URL or ID: Enter the full URL of the YouTube video or just its video ID (e.g.,
dQw4w9WgXcQ). - Output format: Choose between
MP4 (Video)orMP3 (Audio). - Desired quality: Select
Highest,Medium, orLowestquality for your chosen format. - Output directory: Specify the path where you want to save the downloaded file. A default path (current working directory) with a sanitized video title will be suggested.
Example Walkthrough
$ npmytd
Welcome to NPMYTD - YouTube Downloader CLI!
? Enter YouTube video URL or ID: https://www.youtube.com/watch?v=dQw4w9WgXcQ
? Select output format: MP4 (Video)
? Select desired quality for MP4: Highest (Best available video quality)
? Enter output directory (absolute or relative path): C:\Users\GraphStats\Desktop\MyDownloads\Never-Gonna-Give-You-Up-Official-Music-Video.mp4
Downloading "Rick Astley - Never Gonna Give You Up (Official Music Video)" as MP4...
[========================================] 100% | ETA: 0s | total: 4.8MB
Download completed: C:\Users\GraphStats\Desktop\MyDownloads\Never-Gonna-Give-You-Up-Official-Music-Video.mp4
Process completed successfully!Troubleshooting
ffmpegnot found for MP3 conversion: If you selected MP3 format and encounter an error aboutffmpegnot being found, it's becauseyt-dlp(whichnpmytduses for downloads) requiresffmpegto extract and convert audio to MP3. Please ensureffmpegis installed and properly added to your system'sPATH.- Video Unavailable or
yt-dlperrors: Some YouTube videos may be age-restricted, private, or have been removed. Additionally, YouTube frequently updates its website, which can sometimes causeyt-dlpto fail temporarily. If you encounter errors, please ensureyt-dlpis up to date (yt-dlp -U) andffmpegis correctly installed.
License
This project is licensed under the MIT License.
Author
GraphStats
