
This is just a two-line program but to convert it to GUI YouTube Video Downloader is a bit longer still, this program of GUI YouTube Video Downloader is less than 25 lines.
But still, if you want that two-line program then click here.
We have explained this program in every line to make it understand easily for you.
We have created two entry widgets, one to ask the user to enter the URL or link of a YouTube video and the other to add that link.
Then, we have called the download function using the “Download Video” button.
You can download the pytube module using"pip install pytube" but if this gives you the error then you should try "pip install pytube3" inside your terminal.
Now, let’s see the code and understand.
Code
# importing tkinter
from tkinter import *
# importing YouTube module
from pytube import YouTube
# initializing tkinter
root = Tk()
# setting the geometry of the GUI
root.geometry("400x350")
# setting the title of the GUI
root.title("Youtube video downloader application")
# defining download function
def download():
# using try and except to execute program without errors
try:
myVar.set("Downloading...")
root.update()
YouTube(link.get()).streams.first().download()
link.set("Video downloaded successfully")
except Exception as e:
myVar.set("Mistake")
root.update()
link.set("Enter correct link")
# created the Label widget to welcome user
Label(root, text="Welcome to youtube\nDownloader Application", font="Consolas 15 bold").pack()
# declaring StringVar type variable
myVar = StringVar()
# setting the default text to myVar
myVar.set("Enter the link below")
# created the Entry widget to ask user to enter the url
Entry(root, textvariable=myVar, width=40).pack(pady=10)
# declaring StringVar type variable
link = StringVar()
# created the Entry widget to get the link
Entry(root, textvariable=link, width=40).pack(pady=10)
# created and called the download function to download video
Button(root, text="Download video", command=download).pack()
# running the mainloop
root.mainloop()Output

Also read:
- You Can Now Run AI Fully Offline on Your Phone — Google’s Gemma 4 Just Changed Everything
What if your smartphone could run a powerful AI assistant without internet, without cloud, and without API costs? That’s now possible. Google recently introduced a new generation of compact AI models designed specifically for on-device use, and they can run entirely offline on consumer phones using the AI Edge Gallery app. This marks a major… - I Built a 24×7 AI Blogging System for WordPress Using Python (Free) — Full Code Inside
In this article, I will show you how I built a powerful Python-based system that automatically generates and publishes articles to WordPress — completely free and running 24×7. This project handles everything: All you need to do is provide keywords. What This System Actually Does This is not just a script—it’s a complete automation pipeline…. - This Reddit User “Hacked” AI With Simple Tricks… And The Results Are Insane
What if you could get dramatically better answers from AI—without any advanced prompting skills, tools, or coding? A recent Reddit post is going viral for exactly this reason. The user claims they’ve been “manipulating” AI models using simple psychological tricks—and surprisingly, the results are much better. Now, this isn’t some technical exploit or hidden feature…. - One “rm -rf” Command Almost Wiped Out $100 Million Worth of Toy Story 2
In software, a single command can make or break everything. But in the late 1990s, one mistake at Pixar nearly erased months of work—and potentially $100 million worth of production—on Toy Story 2. This isn’t a myth. It’s a real incident that developers still talk about today. What Actually Happened During production, the team was… - How to Make Money with ChatGPT in 2026: A Real Guide That Still Works
There’s a silent thought many people are carrying right now. It doesn’t always get said out loud, but it’s there: “AI has made everything too competitive… maybe it’s too late now.” It feels like everyone is doing something online. Everyone has access to tools like ChatGPT. Content is everywhere. Freelancers are everywhere. Ideas are everywhere….








