A Python command-line tool that retrieves the highest-quality available audio stream using yt-dlp and converts it to MP3 at a configurable bitrate through FFmpeg. It supports individual URLs and batch processing from link lists.
- Convert a single YouTube URL to MP3
- Process multiple URLs from a text file
- Choose 128, 192, 256, or 320 kbps
- Retrieve the best available audio stream
- Create safe, readable filenames
- Continue a batch when one URL fails
- Avoid overwriting existing files unless requested
- Python 3.9 or later
- FFmpeg installed and available on your system PATH
- pip
- Download a Windows FFmpeg build.
- Extract it, for example to
C:\ffmpeg. - Add
C:\ffmpeg\binto the WindowsPathenvironment variable. - Open a new terminal and run:
ffmpeg -versionpython -m venv venv
venv\Scripts\activate
pip install -r requirements.txtpython converter.py --url "YOUTUBE_URL"
python converter.py --url "YOUTUBE_URL" --bitrate 320
python converter.py --url "YOUTUBE_URL" --output downloads
python converter.py --file links.example.txt --bitrate 192Use --overwrite to replace an existing file with the same name.
youtube-mp3-converter/
├── converter.py
├── requirements.txt
├── README.md
├── LICENSE
├── .gitignore
├── links.example.txt
└── output/
└── .gitkeep
Only download content that you own, have permission to download, or are otherwise legally authorized to access. You are responsible for complying with YouTube's Terms of Service and applicable copyright laws.
Licensed under the MIT License.