yt-audio
v1.0.1
Published
Download and merge audio clips from YouTube videos
Downloads
11
Readme
yt-audio
A command-line tool to download and merge audio clips from YouTube videos.
Features
- Extract audio from specific time ranges in YouTube videos
- Merge multiple audio clips into a single file
- Interactive mode for easy input
- Batch processing through a text file
Installation
npm install -g yt-audioThis installs the tool globally, making it available as a command from any directory.
Prerequisites
- Node.js: nodejs.org
- FFmpeg: Required for audio processing
Installing FFmpeg
Windows:
- Download from ffmpeg.org/download.html
- Add to your PATH environment variable
Mac:
brew install ffmpegLinux:
sudo apt update && sudo apt install ffmpegQuick Start
Interactive Mode
yt-audioFollow the prompts and enter each YouTube URL with start and end times:
> https://www.youtube.com/watch?v=dQw4w9WgXcQ 00:30 01:45Press Enter on an empty line when done.
Using a File
Create a text file with URLs and timestamps:
https://www.youtube.com/watch?v=dQw4w9WgXcQ 00:30 01:45
https://www.youtube.com/watch?v=9bZkp7q19f0 01:15 02:30Then run:
yt-audio --input playlist.txt --output mix.mp3Command Options
yt-audio [options]Options:
-i, --input <path>- Path to input file with YouTube URLs and timestamps-o, --output <filename>- Output filename (default: merged_audio.mp3)-f, --format <format>- Output audio format (default: mp3)-b, --bitrate <bitrate>- Output audio bitrate (default: 128k)
Examples
Extract clips from multiple videos and save as high-quality audio:
yt-audio -i favorites.txt -o compilation.mp3 -b 320kFor Non-Developers
If you're new to command-line tools:
- Install Node.js from nodejs.org
- Install FFmpeg (see instructions above)
- Open a terminal or command prompt
- Run:
npm install -g yt-audio - Run:
yt-audioand follow the instructions
Time Formats
Supported formats:
HH:MM:SS(hours:minutes:seconds)MM:SS(minutes:seconds)SS(seconds)
License
MIT
Legal Notice
This tool is for personal use only. Please respect copyright and only download content you have permission to use.
