-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
42 lines (35 loc) · 1.24 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
print("Welcome to YouTube Downloader and Converter v0.2 Alpha")
print("Loading...")
import pytube
import youtube_downloader
import file_converter
print('''
What do you want?
(1) Download YouTube Videos Manually
(2) Download a YouTube Playlist
(3) Download YouTube Videos and Convert Into MP3
Downloading copyrighted YouTube videos is illegal!
I am not responsible for your downloads! Go at your own risk!
Copyright (c) 2020
''')
choice = input("Choice: ")
if choice == "1" or choice == "2":
quality = input("Please choose a quality (low, medium, high, very high):")
if choice == "2":
link = input("Enter the link to the playlist: ")
print("Downloading playlist...")
youtube_downloader.download_playlist(link, quality)
print("Download finished!")
if choice == "1":
links = youtube_downloader.input_links()
for link in links:
youtube_downloader.download_video(link, quality)
elif choice == "3":
links = youtube_downloader.input_links()
for link in links:
print("Downloading...")
filename = youtube_downloader.download_video(link, 'low')
print("Converting...")
file_converter.convert_to_mp3(filename)
else:
print("Invalid input! Terminating...")