YT Playlist to MP3 is a lightweight Python utility that downloads audio from YouTube videos or playlists and automatically converts them to high-quality MP3 files using yt-dlp and FFmpeg.
The tool provides a simple CLI workflow that allows downloading either:
- a single video
- a full playlist
and converts the extracted audio to MP3 while storing the results in a structured local directory.
Download all videos from a YouTube playlist and convert them to MP3.
Download and convert individual YouTube videos.
Uses yt-dlp to extract the best available audio stream.
Uses FFmpeg to convert audio to high-quality MP3.
Allows reading cookies from your browser to bypass YouTube restrictions when needed.
Interactive menu for quick use without command-line parameters.
The tool depends on the following components:
- Python 3.10+
- yt-dlp
- FFmpeg
- Optional: Node.js (recommended for modern YouTube extraction)
git clone https://github.com/rwxce/yt-playlist-to-mp3.git
cd yt-playlist-to-mp3Linux / macOS
python -m venv venv
source ./venv/bin/activateWindows (Git Bash)
python -m venv venv
source ./venv/Scripts/activateWindows (PowerShell)
python -m venv venv
.\venv\Scripts\Activate.ps1pip install -r requirements.txtThe project currently requires:
yt-dlp
FFmpeg is required to convert downloaded audio into MP3 format.
Install using winget:
winget install Gyan.FFmpegVerify installation:
ffmpeg -versionsudo apt update
sudo apt install ffmpegsudo dnf install ffmpegsudo pacman -S ffmpegVerify installation:
ffmpeg -versionInstall using Homebrew:
brew install ffmpegVerify installation:
ffmpeg -versionIf FFmpeg is not installed, yt-dlp will download the audio but will not be able to convert it to MP3.
Newer versions of YouTube sometimes require a JavaScript runtime.
Install Node.js:
winget install OpenJS.NodeJS.LTSVerify:
node -vRun the program:
python main.pyYou will see the menu:
Welcome to the Youtube Downloader
1) Playlist
2) Single Video
If YouTube blocks the download, you can load cookies from your browser.
Example input:
chrome
firefox
edge
Leave empty to skip.
Downloaded files are stored in:
result/Jazz/
Example output:
result/
└── Jazz/
├── Autumn Leaves.mp3
├── So What.mp3
└── Blue in Green.mp3
Files are automatically converted to MP3.
By default, downloaded files are saved in:
result/Jazz/
You can change the genre folder name in the script to organize downloads by music style.
YT Playlist to MP3/
│
├── main.py
├── requirements.txt
├── README.md
│
└── result/
└── Jazz/
The script internally runs:
yt-dlp --extract-audio --audio-format mp3
Workflow:
YouTube
↓
yt-dlp downloads audio stream
↓
FFmpeg converts audio → MP3
↓
File saved locally
This project is intended for:
- Personal offline music listening
- Educational purposes
- Automation of playlist downloads
- Archiving publicly available audio content
Users are responsible for complying with YouTube Terms of Service and copyright laws.
This tool is intended for personal and educational use only.
This project is licensed under the MIT License.
See the LICENSE file for details.
Contributions are welcome.
Possible improvements:
- Automatic playlist folder naming
- Metadata tagging (artist/title)
- Progress bar UI
- Parallel downloads
- CLI argument support