Skip to content

YouTube Playlist Downloader. This repository provides a general-purpose script for downloading YouTube playlists, channels, or individual videos as high-quality video files. The script uses yt-dlp and ffmpeg to download and merge video and audio files into a single file.

Notifications You must be signed in to change notification settings

AmirHaytham/youtube_playlist_downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Playlist Downloader

This repository provides a script for downloading YouTube playlists, channels, or individual videos as high-quality video files. The script utilizes yt-dlp and ffmpeg to download and merge video and audio files into a single, unified file.

Table of Contents

Features

  • Download YouTube playlists, individual videos, or all videos from a channel.
  • Download videos in high-quality (up to 1080p).
  • Automatically merge video and audio using ffmpeg.
  • Show download progress in the terminal with an easy-to-read progress bar.

Motivation

I created this script because I needed to download some educational courses from YouTube for offline viewing. Specifically, I wanted to download:

  1. A YouTube playlist containing AWS courses: AWS Course Playlist.
  2. Another English course by Mr. Ihab Ramzi, available on his channel: Ihab Ramzi's Channel.

This script allows you to provide a link to an individual video, a playlist, or even the entire videos page of a channel, such as Ihab Ramzi's Videos, and it can download all the videos efficiently.

Installation

Prerequisites

To verify the installations, open a terminal and run:

node -v
npm -v
python --version

Clone the Repository

Clone the repository to your local machine and navigate into the project directory:

git clone https://github.com/AmirHaytham/youtube_playlist_downloader.git
cd youtube_playlist_downloader

Install Required Dependencies

Install the required Node.js packages:

npm install progress

Download and Set Up Tools

  • Download yt-dlp:

    • Visit the yt-dlp releases page and download the yt-dlp.exe file.
    • Save yt-dlp.exe in a directory, such as C:\yt-dlp\.
  • Download ffmpeg:

    • Visit the ffmpeg download page, and download a Windows build (e.g., from gyan.dev).
    • Extract the downloaded ZIP file and locate ffmpeg.exe in the bin folder.
    • Move ffmpeg.exe to a directory, such as C:\ffmpeg\bin\.

Add yt-dlp and ffmpeg to Your Script

Update the script file (downloadPlaylist.js) with the correct paths to yt-dlp and ffmpeg:

// Paths to yt-dlp and ffmpeg executables
const ytDlpPath = 'C:\\yt-dlp\\yt-dlp.exe'; // Update to the actual path where yt-dlp.exe is located
const ffmpegPath = 'C:\\ffmpeg\\bin\\ffmpeg.exe'; // Update to the actual path where ffmpeg.exe is located

Usage

  1. Set the desired playlist, video, or channel URL in the playlistUrl variable within the script.

    Example URLs:

    • Playlist URL: https://www.youtube.com/watch?v=E3nLSHQtLes&list=PLOoZRfEtk6kWSM_l9xMjDh-_MJXl03-pf
    • Channel videos page: https://www.youtube.com/@IhabRamziyallaspeak/videos
  2. Run the script to start downloading videos:

    node downloadPlaylist.js

    This command will start the download process, showing progress for each video in the terminal.

Backlog (User Stories)

  • Add functionality to download video and audio from YouTube playlists.
  • Integrate yt-dlp for high-quality video downloads.
  • Integrate ffmpeg to merge audio and video files.
  • Add a progress bar to show download status.
  • Add functionality to download all videos from a channel.
  • Create a setup script for easier installation.
  • Add error handling for unsupported formats or unavailable videos.

About

YouTube Playlist Downloader. This repository provides a general-purpose script for downloading YouTube playlists, channels, or individual videos as high-quality video files. The script uses yt-dlp and ffmpeg to download and merge video and audio files into a single file.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published