I have been using pytube to download youtube videos in python. So far I have been able to download in mp4 format.
yt = pytube.YouTube(\"https://www.youtube.com/
I am assuming you are using Python 3 and pytube 9.x, you can use the filter method to "filter", the file extension you are interested in.
For example, if you would like to download mp4 video file format it would look like the following:
pytube.Youtube('url here').streams.filter(file_extension='mp4').first()
if you would like to pull audio it would look like the following:
pytube.Youtube('url here').streams.filter(only_audio=True).all()
Hope that helps anyone landing on this page; rather than converting unnecessarily.