Download Youtube video using python
Downloading Youtube video and audio is illegal. Whatever many third party site or app provides this feature by showing some annoying adds . We know any programming language is powerful to do any work by digital machine . Python has its module which is pytube allow us to download youtube video and audio file . For this purpose , you have to install python as well as pytube , you can download pytube by using following command on windows command prompt,
pip install pytube
If pytube is already downloaded , following result will occurs on CMD
Python source code for downloading Youtube video :
from pytube import YouTube
link = input("Video url : ")
yt = YouTube(link)
print(yt.title)
print(yt.thumbnail_url)
videos = yt.streams.filter(progressive = True)
i = 1
for stream in videos:
print(str(i)+ " " +str(stream))
i += 1
stream_number = int(input("enter number :"))
video = videos[stream_number-1]
video.download()
video.on_complete(print("Video Downloaded Succesfully ."))
Note : It does not work for some videos . Watch video , click here
You can also check :
Tags:
Python
Share:
nice post. continue blogging.
ReplyDeletethis is the best way to save youtube video