├── Capture.PNG ├── README.md └── YouTubeDownloader.py /Capture.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vkpdeveloper/YouTube-Video-Downloader-in-Python-Tkinter-GUI/62473e0e5e9030afdf0f7865050fe40999839aeb/Capture.PNG -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # YouTube-Video-Downloader-in-Python-Tkinter-GUI 2 | This is the Simple Project for using Python Tkinter to make a Graphical User Interface (GUI) to Download YouTube Videos. 3 | 4 | ![alt text](https://github.com/vkpdeveloper/YouTube-Video-Downloader-in-Python-Tkinter-GUI/blob/master/Capture.PNG) 5 | 6 | ## FIX 7 | 8 | 13 | 14 | ### Thanks for using.... 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /YouTubeDownloader.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | from tkinter import ttk 3 | import os 4 | from pytube import YouTube 5 | from tkinter import messagebox as m_box 6 | import subprocess 7 | import threading 8 | 9 | def onClick(): 10 | got_link = link.get() 11 | got_path = path.get() 12 | try: 13 | yt = YouTube(str(got_link)) 14 | except: 15 | m_box.showerror("Error", "Connection Problem !") 16 | else: 17 | vid = yt.streams.get_highest_resolution() 18 | destination = str(got_path) 19 | vid.download(destination) 20 | os.startfile(got_path) 21 | return m_box.showinfo('Successfully Downloaded.', f"Your YouTube Vidoe Downloaded Successfully at {got_path}/{yt.title}") 22 | 23 | 24 | threads = [] 25 | 26 | 27 | def startThredProcess(): 28 | myNewThread = threading.Thread(target=onClick) 29 | threads.append(myNewThread) 30 | myNewThread.start() 31 | 32 | win = tk.Tk() 33 | win.geometry("500x400") 34 | win.title("YouTube Video Downloader") 35 | win.minsize(500, 400) 36 | win.maxsize(500, 400) 37 | frame = ttk.LabelFrame(win) 38 | frame.grid(row=0, column=0, padx=70, pady=90) 39 | 40 | get_info = ttk.Label(frame, text="Enter YouTube Video Link : ") 41 | get_info.grid(row=0, column=0, sticky=tk.W) 42 | 43 | link = tk.StringVar() 44 | 45 | yt_link = ttk.Entry(frame, width=60, textvariable=link) 46 | yt_link.grid(row=1, columnspan=3, padx=0, pady=3) 47 | yt_link.focus() 48 | 49 | get_info = ttk.Label(frame, text="Enter Downloading Path : ") 50 | get_info.grid(row=3, column=0, sticky=tk.W) 51 | 52 | path = tk.StringVar() 53 | 54 | download_path = ttk.Entry(frame, width=60, textvariable=path) 55 | download_path.grid(row=4, columnspan=3, padx=0, pady=3) 56 | 57 | btn1 = ttk.Button(frame, text="Download Video", 58 | width=15, command=startThredProcess) 59 | btn1.grid(row=7, columnspan=3, padx=13, pady=7) 60 | 61 | win.mainloop() 62 | --------------------------------------------------------------------------------