Created
August 25, 2021 17:49
-
-
Save yogeshsinghgit/2806d6b5629bee0bb77778bad54f285d to your computer and use it in GitHub Desktop.
Get YouTube Video Information/Metadata using Python Pytube Module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
showing this error while giving any youtube link