Featured Photo by Cottonbro Studio on Pexels
Here is the simplest NLP example – the Python based YouTube video Downloader GUI Application by Naem Azam.
Let’s try to download the following YouTube video
Let’s set the working directory YOURPATH
import os
os.chdir(‘YOURPATH’)
os. getcwd()
while importing, cloning and/or installing relevant libraries
!pip install gitpython
!pip install git
git clone https://github.com/naemazam/Youtube-video-Downloader.git
import tkinter as tk
from tkinter import *
from PIL import ImageTk, Image
from tkinter import messagebox
import pytube
import time
!pip install –upgrade pytube
Adding Window Components
root = tk.Tk()
root.title(“Youtube Downloader”)
root.geometry(“700×300”)
root.maxsize(700,250)
root.minsize(700,300)
and the GUI function code
def download():
link = text.get(“1.0″,”end-1c”)
if link == '':
messagebox.showerror("YouTube Downloader", "Please paste a link here")
else:
yt = pytube.YouTube(link)
stream = yt.streams.first()
time.sleep(2)
text.delete(1.0,'end')
text.insert('end','Wait Downloading ......')
time.sleep(5)
stream.download()
messagebox.showinfo("YouTube Downloader",'Video has been download successfully')
The main design code is
header = Label(root,bg=”black”,width=”300″,height=”2″)
header.place(x=0,y=0)
with the youtube logo png image
yt_logo = ImageTk.PhotoImage(Image.open(‘youtube.png’))
logo = Label(root, image = yt_logo,borderwidth=0)
logo.place(x=10,y=10)
by adding the caption label
caption = Label(root,text=”YouTube Downloader”,font=(‘verdana’,10,’bold’))
caption.place(x=50,y=10)
and the youtube logo image
yt1_logo = ImageTk.PhotoImage(Image.open(‘yt.png’))
logo1 = Label(root, image = yt1_logo,borderwidth=0)
logo1.place(x=300,y=60)
Let’s get the url
text = Text(root,width=60,height=2,font=(‘verdana’,10,’bold’))
text.place(x=90,y=180)
text.insert(‘end’,’Paste your video link here’)
Download Buttons
button = Button(root,text=”Download”,relief=RIDGE,font=(‘verdana’,10,’bold’),bg=”red”,fg=”white”,command=download)
button.place(x=330,y=220)
and load the window
root.mainloop()
Let’s run the GUI code as follows:

Let’s paste the above URL link and hit Download


Outcome: You should see the 3GPP File in YOURPATH. One can view the content with Movies & TV.
Explore More
Build A Simple NLP/NLTK Chatbot
Make a one-time donation
Make a monthly donation
Make a yearly donation
Choose an amount
Or enter a custom amount
Your contribution is appreciated.
Your contribution is appreciated.
Your contribution is appreciated.
DonateDonate monthlyDonate yearly