Skip to content

This python script enables to download entire playlist from YouTube into Mp3 format. Best for music downloads.

License

Notifications You must be signed in to change notification settings

malikumairlatif/YouTube-Playlist-and-Mix-Downloader-Video-to-Mp3

Repository files navigation

YouTube MP3 Downloader

A Python-based YouTube MP3 Downloader that allows you to download audio from YouTube videos or playlists and convert them to MP3 format.

Features

  • Download audio from individual YouTube videos or entire playlists.
  • Convert downloaded audio to MP3 format.
  • Display download progress.
  • Retry mechanism for failed downloads.
  • Skip age-restricted content.
  • Organize and save downloaded files to a specified directory.

Dependencies

This project requires the following Python libraries:

  • pytube: For downloading YouTube videos.
  • pydub: For converting audio files.
  • tqdm: For displaying download progress.
  • requests: For making HTTP requests.
  • ffmpeg: Required by pydub for audio conversion.

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/youtube-mp3-downloader.git
    cd youtube-mp3-downloader
    
  2. Install the required dependencies:

    pip install -r requirements.txt

    Ensure your requirements.txt contains:

    pytube
    pydub
    tqdm
    requests
    

Usage:

  1. Run the script:
python download_youtube.py
  1. Enter the YouTube playlist or Mix URL when prompted.
  2. Enter the download destination path when prompted.

Step 1: Install ffmpeg

  1. Windows:

    • Download the ffmpeg build for Windows from FFmpeg.org.
    • Extract the downloaded zip file.
    • Move the bin folder (which contains ffmpeg.exe) to a convenient location, for example, C:\ffmpeg\bin.
  2. MacOS:

    • Install ffmpeg using Homebrew:Install ffmpeg using your package manager, for example, on Ubuntu:

      brew install ffmpeg

  3. Linux:

sudo apt update
sudo apt install ffmpeg

Step 2: Add ffmpeg to System PATH

  1. Windows:

    • Open the Start Search, type in "env", and select "Edit the system environment variables."
    • In the System Properties window, click on the "Environment Variables" button.
    • In the Environment Variables window, under System variables, find the PATH variable, select it, and click Edit.
    • Click New and add the path to the ffmpeg bin directory, e.g., C:\ffmpeg\bin.
    • Click OK to close all the windows.
  2. MacOS and Linux:

    • Open your terminal and add ffmpeg to your PATH by editing your shell configuration file (.bashrc, .zshrc, etc.):

export PATH="/usr/local/bin:$PATH"

    • Save the file and source it:

source ~/.bashrc # or source ~/.zshrc

Step 3: Verify ffmpeg Installation

To ensure that ffmpeg is properly installed and accessible from your PATH, open a terminal or command prompt and run:

ffmpeg -version

You should see the ffmpeg version information printed, indicating that it's correctly installed.

Contributing

Contributions are welcome! Please fork this repository and submit pull requests with your changes. Make sure to follow the coding standards and add appropriate documentation.

About

This python script enables to download entire playlist from YouTube into Mp3 format. Best for music downloads.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages