In this blog, we will see how we can download YouTube videos using a Python package called pytube. We will also download multiple videos from the YouTube playlist.
What is pytube?
pytube is a genuine, lightweight, dependency-free Python library (and command-line utility) for downloading YouTube videos.
pytube also makes pipelining easy, allowing you to specify callback functions for different download events, such as on progress or on complete.
Features
1. Support for both progressive & DASH streams
2. Support for downloading the complete playlist
3. Easily register on_download_progress & on_download_complete callbacks
4. Command-line interfaced included
5. Caption track support
6. Outputs caption tracks to .srt format (SubRip Subtitle)
7. Ability to capture thumbnail URL
8. Extensively documented source code
9. No third-party dependencies
Installation via pip
pip install pytube
conda install
conda install -c conda-forge pytube