This Python script allows you to download and merge the best quality video and audio from YouTube using yt-dlp
. It automatically installs yt-dlp
if it's not already installed on your system.
- Python 3.x
ffmpeg
must be installed on your system for merging video and audio streams.
- Download
ffmpeg
from FFmpeg's official site. - Extract the ZIP file and add the
bin
directory to your system's PATH environment variable.
Install ffmpeg
using Homebrew:
brew install ffmpeg
Install ffmpeg
using your package manager. For example, on Ubuntu:
sudo apt update
sudo apt install ffmpeg
-
Clone this repository:
git clone https://github.com/aswinop/yt-downloader.git cd yt-downloader
-
Run the script:
python download_video.py
-
Select the method when prompted:
Methods Available:- 1) Auto Detect 2) Download Youtube Video 3) Download Youtube Music 4) Advanced Options Your Choice:
-
Enter the YouTube video/music URL when prompted:
Enter the YouTube video URL: https://www.youtube.com/watch?v=your-video-id
OR
Enter the Youtube Music URL: https://music.youtube.com/watch?v=your-video-id
-
The script will download the best available video and audio streams, merge them, and save the file in the current directory.
yt-dlp is not installed. Installing now...
[yt-dlp] Downloading video...
Title: Example Video Title
Download completed! File saved as Example Video Title.mp4
Feel free to submit issues or pull requests to improve the script.
This project is licensed under the MIT License - see the LICENSE file for details.