A beautiful and feature-rich command-line YouTube to MP3 downloader built with Python. This tool provides an enhanced terminal UI, allowing you to preview video details before downloading and track progress with a clean, informative progress bar. It also automatically adds cover art and metadata to your downloaded tracks for a seamless music library experience. Note: The installation instructions below are currently tailored for Linux and macOS systems.
- Enhanced Terminal UI: Leveraging the
richlibrary for a modern, colorful, and clean command-line experience. - Video Preview: See video details (title, duration, size) before you commit to the download.
- Smart Progress Bar: Track your downloads in real-time with an accurate and aesthetic progress indicator.
- Persistent Configuration: Remembers your preferences to streamline future downloads.
- Flexible Audio Quality: Choose your preferred bitrate: Best (Variable), 320kbps, 192kbps (Default), or 128kbps.
- Automatic Cover Art & Metadata: Automatically embeds thumbnails as album art and fills in ID3 tags (title, artist).
- System-Wide Installation: Easy to set up as a global command for access from any directory.
Follow these steps to get YTmp3 running on your system.
Ensure you have Python 3.6+ installed. You also need yt-dlp and ffmpeg installed on your system.
Install yt-dlp:
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && sudo chmod a+rx /usr/local/bin/yt-dlpInstall ffmpeg:
- Ubuntu/Debian:
sudo apt install ffmpeg -y
- Fedora, CentOS, RHEL:
sudo dnf install ffmpeg
- Arch Linux:
sudo pacman -S ffmpeg
- macOS (via Homebrew):
brew install ffmpeg
git clone https://github.com/iiiggoo/YTmp3.git && cd YTmp3It is recommended to use a virtual environment to keep your global Python installation clean.
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# On Linux/macOS:
source venv/bin/activate
# On Windows:
# venv\Scripts\activate
# Install dependencies
pip3 install -r requirements.txtIf you want to run ytmp3 from anywhere in your terminal:
First, navigate to your project directory and run this command :
nano ytmp3Now change the PATH to be compatible with your files placing:
#!/bin/bash
# This wrapper script activates the virtual environment and runs the Python script
# Set the path to your project's virtual environment(change the PATH based on your placing)
VENV_PATH="/home/your_username/YTmp3/venv/bin/activate"
# Set the path to your actual Python script(change the PATH based on your placing)
SCRIPT_PATH="/home/your_username/YTmp3/ytmp3.py"
# Check if the virtual environment exists(don't modify it)
if [ ! -f "$VENV_PATH" ]; then
echo "Error: Virtual environment not found at $VENV_PATH"
exit 1
fi
# Check if the Python script exists(don't modify it)
if [ ! -f "$SCRIPT_PATH" ]; then
echo "Error: Python script not found at $SCRIPT_PATH"
exit 1
fi
# Activate the virtual environment and run the script(don't modify it)
source "$VENV_PATH"
python3 "$SCRIPT_PATH" "$@"Move the ytmp3 file to the bin folder in your system:
# make the file executable
chmod +x ytmp3
# move it to the bin folder
sudo mv ytmp3 /usr/local/bin/ytmp3Once installed, you can launch the downloader by simply typing:
ytmp3Alternatively, if you didn't perform the system-wide install:
python ytmp3.pyImportant
Note: Currently, YTmp3 is designed for single video URLs only. Support for playlists is not available at this time , make sure its one video URL not a palylist URL.
- Update yt-dlp: YouTube frequently updates its platform, which can break downloaders. If you encounter issues, update your system's
yt-dlpfirst:yt-dlp -U
- FFmpeg Path: Ensure
ffmpegis in your system's PATH. You can check this by runningffmpeg -versionin your terminal. If the command isn't found, re-run the installation steps in Step 1. - Metadata: Metadata extraction depends on the information provided by the YouTube uploader.
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Built with ❤️ using Python and the Rich library.