-
Notifications
You must be signed in to change notification settings - Fork 0
/
youtubeDL.py
44 lines (30 loc) · 943 Bytes
/
youtubeDL.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
43
44
from pytube import Playlist
from pytube import YouTube
from tqdm import tqdm
def downloadVideo(url):
try:
yt = YouTube(url)
yt.streams.get_highest_resolution().download()
#yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution')[-1].download()
except :
print("A problem occured while dowloading video")
def downloadPlaylist(url):
try:
pl = Playlist(url)
for video in tqdm(pl):
video.streams.get_highest_resolution().download()
except :
print("A problem occured while dowloading playlist")
print("[+] Tek video icin 1")
print("[+] Playlist icin 2")
select = int(input())
print("Video Linki :")
url = input().strip()
print("İndirme işleminiz başlıyor..")
print()
if select == 1 and url != "":
downloadVideo(url)
elif select == 2 and url != "":
downloadPlaylist(url)
else:
print("! Hata")