Last Updated on March 26, 2023 by mishou
Let me show you how to download a Youtube video in the simple way with pytube. You can learn about pytube here:
https://pytube.io/en/latest/user/streams.html
https://github.com/pytube/pytube
You can use pytube in a IDE like Jupyter Notebook but it is simpler to use the command-line interface. The downloaded should be set for “progressive download”, resolutions 720p at highest.
In the terminal run the following commands if you use conda.
1.Open the virtual environment.
conda activate YOURENVIRONMENT
2.Install pytube
python -m pip install git+https://github.com/pytube/pytube
3.Download the Youtube video file at your home directory
pytube URL
You will get a video at the highest progressive quality. If you want to get the higher quality video, see the tutorial:
https://pytube.io/en/latest/user/streams.html