Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube-to-MP3 Converter

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.

Features

  • 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

Requirements

  • Python 3.9 or later
  • FFmpeg installed and available on your system PATH
  • pip

Install FFmpeg on Windows

  1. Download a Windows FFmpeg build.
  2. Extract it, for example to C:\ffmpeg.
  3. Add C:\ffmpeg\bin to the Windows Path environment variable.
  4. Open a new terminal and run:
ffmpeg -version

Setup

python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt

Usage

python 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 192

Use --overwrite to replace an existing file with the same name.

Project Structure

youtube-mp3-converter/
├── converter.py
├── requirements.txt
├── README.md
├── LICENSE
├── .gitignore
├── links.example.txt
└── output/
    └── .gitkeep

Responsible Use

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.

License

Licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages