Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement