Modified from the code supplied in https://www.youtube.com/watch?v=vEQ8CXFWLZU by Internet Made Coder.
Added link validation, and also the download progress bar. The progress bar idea is from https://stackoverflow.com/a/68419849/5258525.
Have Python 3 installed. Download it from https://www.python.org/downloads/
Install pytube library (version 15):
pip install pytube
Run the downloader.py in the terminal/Powershell, then supply the Youtube URL to download:
$ python .\downloader.py
Youtube link: https://www.youtube.com/watch?v=vEQ8CXFWLZU
Title: 3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
Views: 532649
Downloading...
Done!███████████████████████████████████████████████████████████████████████████████████████| 100.0%
- PyTube: https://pytube.io/