Skip to content

Commit 25b8fac

Browse files
committed
Added Youtube Downloader
1 parent a46a6ff commit 25b8fac

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

YoutubeDownloader.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#pip install pytube to install library
2+
from pytube import YouTube
3+
link = input("Enter youtube url:")
4+
yt = YouTube(link)
5+
6+
SAVE_PATH = "E:/"
7+
8+
#Title of Video
9+
print("Title:",yt.title)
10+
11+
#Number of Views
12+
print("Views:",yt.views)
13+
14+
#Length of Video
15+
print("Length of Video:",yt.length,"seconds")
16+
17+
#Rating of Video
18+
print("Rating:",yt.rating)
19+
20+
x = input("Do you want video or audio(v/a): ")
21+
if x=="v":
22+
print(yt.streams.filter(progressive=True))
23+
ys = yt.streams.get_by_itag('22')
24+
25+
else:
26+
print(yt.streams.filter(only_audio=True))
27+
ys = yt.streams.get_by_itag('251')
28+
29+
#Downloading
30+
print("***DOWNLOADING***")
31+
ys.download(SAVE_PATH)
32+
print("***DOWNLOADED***")

0 commit comments

Comments
 (0)