Skip to content

Commit ea997dd

Browse files
authored
Add files via upload
1 parent f1fdcb3 commit ea997dd

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

youtube_video_v1.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Video Downloader
2+
# By @Bethu05
3+
# v1.0
4+
5+
from pytube import YouTube
6+
7+
# video_url = YouTube('https://youtu.be/crYum29M-VE')
8+
print('\tYoutube MP4 Video Downloader')
9+
# Get Video Url from User
10+
11+
12+
def get_video_id():
13+
# get User to Paste the video Url
14+
url = input('Paste The Video Url: ')
15+
video_url = YouTube(url)
16+
return video_url
17+
18+
19+
def video_downloader(url, folder): # ? Download Specific Video
20+
# Get The highest resolution with pregressive=True and .mp4 file extension
21+
highest_res = url.streams.filter(
22+
progressive=True, file_extension='mp4').get_highest_resolution()
23+
# Download the Highest Resolution to entered folder
24+
highest_res.download(output_path=f'Downloads/{folder}')
25+
26+
27+
try:
28+
folder = input('Enter Folder Name: ')
29+
video_id = get_video_id()
30+
video_downloader(video_id, folder)
31+
except Exception as e:
32+
print(e)

0 commit comments

Comments
 (0)