Q-1. Python program to download the videos from Youtube.

Python Code:

from pytube import YouTube          #importing module
save_path="F:/"                                  #location to save video
link="https://www.youtube.com/watch?v=lJzOa4cPxTI"
try:
    #object creation using youtube
    yt=YouTube("https://www.youtube.com/watch?v=lJzOa4cPxTI")
    print(yt.title)
except:
    print("check internet connection")

stream = yt.streams.first()
try:
    #download video
    stream.download(save_path)
except:
    print("Oops!error occured...")
print("video downloaded!")

Output:

video downloaded!!!

Location where downloaded video is saved

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Insert math as
Block
Inline
Additional settings
Formula color
Text color
#333333
Type math using LaTeX
Preview
\({}\)
Nothing to preview
Insert