An open API service indexing awesome lists of open source software.

https://github.com/chathuraprasanga/youtube-playlist-mp3-downloader

A lightweight Python script to download YouTube playlist videos as high-quality MP3s, optimized for downloading music playlists with clean download progress and file naming. Built with yt-dlp and FFmpeg.
https://github.com/chathuraprasanga/youtube-playlist-mp3-downloader

audio-download cli-tool ffmpeg mp3-converter music-downloader python-script terminal-app youtube-downloader youtube-playlist yt-dlp

Last synced: about 2 months ago
JSON representation

A lightweight Python script to download YouTube playlist videos as high-quality MP3s, optimized for downloading music playlists with clean download progress and file naming. Built with yt-dlp and FFmpeg.

Awesome Lists containing this project

README

          

# ๐ŸŽต YouTube Playlist MP3 Downloader

A Python script to download all songs in a YouTube playlist as MP3 files using `yt-dlp` and `ffmpeg`.

---

## ๐Ÿ“ฆ Features

* โœ… Download YouTube playlist as MP3
* โœ… Automatic audio extraction and conversion using `ffmpeg`
* โœ… Clean console output with real-time progress, download speed, and file size
* โœ… Playlist title and total video count shown
* โœ… Files saved into `downloads_mp3` directory

---

## ๐Ÿ”ง Requirements

* Python 3.8 or above
* [`yt-dlp`](https://github.com/yt-dlp/yt-dlp)
* [`ffmpeg`](https://ffmpeg.org/)

### Install requirements:

```bash
pip install yt-dlp
```

**Install `ffmpeg`:**

* macOS: `brew install ffmpeg`
* Ubuntu/Debian: `sudo apt install ffmpeg`
* Windows (with Chocolatey): `choco install ffmpeg`

---

## ๐Ÿš€ How to Use

1. Clone or download this repository.
2. Open `youtube_mp3_downloader.py` and set your playlist URL:

```python
PLAYLIST_URL = "https://www.youtube.com/playlist?list=YOUR_PLAYLIST_ID"
```

3. Run the script:

```bash
python3 main.py
```

4. MP3 files will be saved in the `downloads_mp3/` folder.

---

## ๐Ÿ“‚ Folder Structure

```
main.py # Main script
downloads_mp3/ # Folder where MP3s are saved
```

---

## ๐Ÿ“œ Output Example

```text
๐Ÿ“… Fetching playlist info...

๐Ÿ“‚ Playlist: My Favorite Songs
๐ŸŽฎ Total videos: 12

[Downloading] -> ๐ŸŽต Song Title.webm 2.10MiB/4.00MiB (52.5%) 700.3 KB/s
[Downloaded] -> ๐ŸŽต Song Title.webm 3.88MB
...
โœ… Done! MP3s saved in: downloads_mp3
```

---

## ๐Ÿง Notes

* Only audio is downloaded (no video).
* Audio is converted to `.mp3` using `ffmpeg`.
* If you receive rate-limit or network errors, try a different network or VPN.

---

## ๐Ÿ›  Customization

To change the audio quality:

```python
'preferredquality': '192' # Can be set to '320' for highest quality
```

To change the output folder:

```python
OUTPUT_FOLDER = "my_music_folder"
```

---

## ๐Ÿชฏ Troubleshooting

* **ffmpeg not found** โ†’ Make sure it's installed and in your system PATH.
* **Playlist not fetching** โ†’ Confirm itโ€™s public and accessible.
* **HTTP 403/400 errors** โ†’ Retry later or use a VPN.

---

## ๐Ÿค Contributing

Feel free to fork, enhance or raise issues.

---

## ๐Ÿ“œ License

This project is licensed under the MIT License.

---

## ๐Ÿ™ Credits

* Python 3
* Built using [yt\_dlp](https://github.com/yt-dlp/yt-dlp)
* Terminal output styled manually
* Special thanks to **ChatGPT-4o** for assistance in scripting and logic design โœจ