try:
from pytube import YouTube
yt = YouTube("youtube url")
print("Title: ",yt.title)
print("Number of views: ",yt.views)
print("Length of video: ",yt.length)
print("Rating of video: ",yt.rating)
yt.streams.get_highest_resolution().download("D:\\file_name.mp4")
except Exception as e:
print(e)