This Python script downloads YouTube videos as MP3 files using yt-dlp
.
- Downloads the best available audio quality.
- Converts the audio to MP3 format (192kbps).
- Supports bulk downloading from a text file containing video URLs.
- Uses
yt-dlp
for improved performance and compatibility.
Ensure you have the following installed:
- Python 3.x
yt-dlp
ffmpeg
Run the following command to install yt-dlp
:
pip install yt-dlp
You also need to install ffmpeg
if it's not already available on your system:
- Windows: Download from FFmpeg official site and add it to your system
PATH
. - Linux/macOS: Install using a package manager, e.g.,
sudo apt install ffmpeg # Debian/Ubuntu brew install ffmpeg # macOS
Modify the script to call download_video_as_mp3(video_url)
, replacing video_url
with the actual YouTube link.
- Create a text file (e.g.,
video_urls.txt
) and list YouTube video URLs, one per line. - Run the script:
python bulk_yt_to_mp3.py
- The script reads video URLs from
video_urls.txt
. - It downloads the best available audio stream.
- The audio is converted to MP3 format (192kbps) using
ffmpeg
.
This project is licensed under the MIT License.
- E-mail: velimir.paleksic@gmail.com.
- VexSystems GitHub: github.com/vexsystems.
- VexSystems Instagram: @vex.systems.