Create and activate a virtual environment:
python -m venv venv
venv\Scripts\activate # Windows
# OR
source venv/bin/activate # macOS/LinuxInstall dependencies:
pip install yt-dlpMake sure ffmpeg is installed and in your system PATH for proper video/audio merging.
To download a YouTube video in 1080p with audio merged, saving it to the downloads/ folder:
python -m yt_dlp -f "bv*[height=1080]+ba" -o "downloads/%(title)s.%(ext)s" "https://youtube.com/watch?v=VIDEO_ID"Replace VIDEO_ID with your actual link.
venv/β Virtual environment (ignored by Git)downloads/β Saved video files (ignored by Git)