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.
- Playlist Downloads: Downloads all videos from a given YouTube playlist URL.
- Folder Naming: Converts the playlist title into an alphanumeric folder name to store downloaded videos.
- High Resolution: Downloads each video with the highest available resolution.
- CLI and GUI: Choose between the CLI version (using
playlist_downloader.py
) or the GUI version (app.py
) for intuitive operation. - Real-Time Updates: The GUI provides real-time download progress and error reporting.
- Executable Build: Easily build an executable using PyInstaller.
- Clone the repository:
git clone https://github.com/DhananjayPorwal/youtube-playlist-downloader.git
- Change into the project directory:
cd youtube-playlist-downloader/youtube-playlist-downloader
- Set up a virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
- Run the CLI script:
python playlist_downloader.py
-
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.
- Run the GUI application:
python app.py
-
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.
Since I'm on Ubuntu, you can build an executable for your environment as follows:
- Build the executable with PyInstaller:
pyinstaller --onefile app.py
-
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.
- This will generate an executable file in the
- Folder Already Exists:
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.
- Unresponsive Behavior:
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.
- The project now uses
yt_dlp
for improved compatibility and performance compared to the legacypytube
library. - For cross-platform builds, remember that executables are OS specific. Currently, only the Ubuntu executable is provided (built with PyInstaller on Ubuntu).