Command-line interface (CLI)

Pytube also ships with a tiny CLI for interacting with videos and playlists.

To download the highest resolution progressive stream:

$ pytube

To view available streams:

$ pytube --list

To download a specific stream, use the itag

$ pytube --itag=22

To get a list of all subtitles (caption codes)

$ pytube --list-captions

To download a specific subtitle (caption code) - in this case the English subtitles (in srt format) - use:

$ pytube -c en

It is also possible to just download the audio stream (default AAC/mp4):

$ pytube -a

To list all command line options, simply type

$ pytube --help

Finally, if you’re filing a bug report, the cli contains a switch called --build-playback-report, which bundles up the state, allowing others to easily replay your issue.