Last Updated on December 26, 2021 by shibatau
Let me show you how to download a Youtube video in the simplest way with pytube. You can learn about pytube here:
You can use pytube in a python script but it is simpler to use the command-line interface. The streams downloaded contain the audio and video in a single file. They are called “progressive download”, resolutions 720p at highest.
In the terminal run the following commands if you have created a virtual environment with Anaconda.
1.Open the virtual environment.
conda activate YOURENVIRONMENT
python -m pip install git+https://github.com/pytube/pytube
3.Download the Youtube video file at your home directory
You will get a video at the highest progressive quality, though it may be the highest of all. If you want to get the highest quality video, Dash video files, see the tutorial: