-
-
Save 2ndBillingCycle/effd6dfb515a5fd142713d552178b627 to your computer and use it in GitHub Desktop.
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
#C Gavin 2018 | |
import os | |
from tkinter import * | |
import pytube | |
import os, getpass | |
if __name__ == "__main__": | |
app = Tk() | |
app.title("Youtube Downloader V1.5") | |
rawurl = StringVar() | |
l = Listbox(app, width=30, height=15) | |
folders = [ | |
"Downloads", | |
"Desktop", | |
"Videos", | |
"Music", | |
"Documents", | |
] | |
for i in range(1,6): | |
l.insert(i, folders[i - 1] | |
app.geometry("400x300") | |
def download(): | |
sel = l.curselection() | |
link = str(rawurl.get()) | |
print('Downloading...') | |
if sel == (0,): | |
folder = folders[0] | |
elif sel == (1,): | |
folder = folders[1] | |
elif sel == (2,): | |
folder = folders[2] | |
elif sel == (1,): | |
folder = folders[3] | |
elif sel == (1,): | |
folder = folders[4] | |
pytube.YouTube(link).streams.first().download("C:/Users/" + str(getpass.getuser()) + folder) | |
print('done') | |
app.destroy() | |
l.place(x=200,y=0) | |
url = Entry(app,textvar = rawurl).place(x=0,y=0) | |
download = Button(app,text = 'Download',command = download).place(x=0,y=25) | |
urllabel = Label(text = 'Full url').place(x=125,y = 0) | |
label = Label(text = 'Youtube Downloader',font='none 16').place(x=0,y = 50) | |
label = Label(text = 'V1.5',font='none 16').place(x=0,y = 75) | |
urllabel = Label(text = 'Destination').place(x=125,y = 25) | |
app.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment