Skip to content

Instantly share code, notes, and snippets.

@yogeshsinghgit
Created August 25, 2021 17:49
Show Gist options
  • Save yogeshsinghgit/2806d6b5629bee0bb77778bad54f285d to your computer and use it in GitHub Desktop.
Save yogeshsinghgit/2806d6b5629bee0bb77778bad54f285d to your computer and use it in GitHub Desktop.
Get YouTube Video Information/Metadata using Python Pytube Module
# importing the module
from pytube import YouTube
# Function Takes YouTube Object as Argument.
def video_Info(yt):
print("Title : ",yt.title)
print("Total Length : ",yt.length," Seconds")
print("Total Views : ",yt.views)
print("Is Age Restricted : ",yt.age_restricted)
print("Video Rating ",round(yt.rating))
print("Thumbnail Url : ",yt.thumbnail_url)
link = "YouTube Video URL "
yt = YouTube(link) # Create Youtube Object..
# call the function
video_info(yt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment