Youtube Playlist Downloader

This repository contains a Python script for downloading YouTube playlist videos using "pytube".

View the Project on GitHub

YouTube Playlist Downloader ✨

youtube-playlist-downloader

This repository contains a Python project for downloading all the videos from a YouTube playlist. The project now includes both a Command Line Interface (CLI) and a Graphical User Interface (GUI) built with PyQt5. The original script has been updated to use yt_dlp (instead of the outdated pytube) to handle the download and conversion process.

Features

GUI Screenshot

Installation

  1. Clone the repository:
git clone https://github.com/DhananjayPorwal/youtube-playlist-downloader.git
  1. Change into the project directory:
cd youtube-playlist-downloader/youtube-playlist-downloader
  1. Set up a virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

Command Line Interface (CLI)

  1. Run the CLI script:
python playlist_downloader.py
  1. Follow the prompt:

    • Enter the YouTube playlist URL when prompted.
    • The script will create a folder (named by the sanitized playlist title and download all videos into it.
    • Progress updates and video size details are displayed in the terminal.

Graphical User Interface (GUI)

  1. Run the GUI application:
python app.py
  1. Using the GUI:

    • Enter the YouTube playlist URL in the provided input field.
    • Click the “Download” button.
    • The GUI displays real-time progress in a log area.
    • A success message is shown when the process is complete.

Creating an Executable

Since I’m on Ubuntu, you can build an executable for your environment as follows:

  1. Build the executable with PyInstaller:
pyinstaller --onefile app.py
  1. Executable:

    • This will generate an executable file in the dist folder.
    • Note: The executable is platform-specific. To create executables for Windows or macOS, you need to build the project on those platforms.

Known Errors

CLI

If a folder with the same name as the playlist already exists, the script will throw an error because it cannot recreate the folder. To resolve, delete or rename the existing folder before running the script.

GUI

The GUI may appear unresponsive during long downloads. This is due to heavy processing in the background thread. Please be patient while the process completes; the GUI logs and final success message indicate completion.

Additional Notes

Resources