Created
August 11, 2018 15:26
-
-
Save ardasevinc/fc99f7241fcf3e92f27dc41ebddad5f5 to your computer and use it in GitHub Desktop.
Youtube video download tool.Created for fun.Only use for personal use. I do not claim any legal responsibilites.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Youtube video download tool | |
import sys | |
import time | |
import easygui as g | |
from pytube import YouTube | |
while True: | |
url= g.enterbox("Please enter url","Youtube download tool") | |
b= g.ynbox("Please wait","Youtube download tool") | |
if b == False: | |
break | |
yt= YouTube(url) | |
msg="Please choose according to your needs" | |
title="Youtube download tool" | |
choices=["Audio","Video","Both"] | |
usr_choice= str.lower(g.buttonbox(msg,title,choices)) | |
if usr_choice == "audio": | |
listAu= yt.streams.filter(only_audio= True).all() | |
msg= "Please choose one itag and remember" | |
title= "Youtube download tool" | |
choices= listAu | |
usr_itag0= g.choicebox(msg,title,choices) | |
usr_itag1= g.enterbox("Enter itag","Youtube download tool") | |
directory= g.diropenbox("Download directory") | |
g.msgbox("Downloading.Please wait.","Youtube download tool","Ok") | |
yt.streams.get_by_itag(int(usr_itag1)).download(directory) | |
usr_input= g.ynbox("Do you want to continue?","Youtube download tool") | |
if usr_input==True: | |
continue | |
else: | |
break | |
elif usr_choice == "video": | |
listVid= yt.streams.filter(only_video=True).all() | |
msg= "Please choose one itag and remember" | |
title= "Youtube download tool" | |
choices= listVid | |
usr_itag0= g.choicebox(msg,title,choices) | |
usr_itag1= g.enterbox("Enter itag","Youtube download tool") | |
directory= g.diropenbox("Download directory") | |
g.msgbox("Downloading.Please wait.","Youtube download tool","Ok") | |
yt.streams.get_by_itag(int(usr_itag1)).download(directory) | |
usr_input= g.ynbox("Do you want to continue?","Youtube download tool") | |
if usr_input==True: | |
continue | |
else: | |
break | |
elif usr_choice == "both": | |
listBoth= yt.streams.filter(progressive=True).all() | |
msg= "Please choose one itag and remember" | |
title= "Youtube download tool" | |
choices= listBoth | |
usr_itag0= g.choicebox(msg,title,choices) | |
usr_itag1= g.enterbox("Enter itag","Youtube download tool") | |
directory= g.diropenbox("Download directory") | |
g.msgbox("Downloading.Please wait.","Youtube download tool","Ok") | |
yt.streams.get_by_itag(int(usr_itag1)).download(directory) | |
usr_input= g.ynbox("Do you want to continue?","Youtube download tool") | |
if usr_input==True: | |
continue | |
else: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment