Youtube Video Downloader Application in Python
Trilochan Parida

Trilochan Parida @techparida

About: #TechEntrepreneur, Passionate about #technology #coding, Love to #troubleshoot #travel

Location:
India
Joined:
Jun 1, 2020

Youtube Video Downloader Application in Python

Publish Date: Dec 16 '20
0 0

You need to install pytube package to download youtube videos

pip3 install pytube

Then run below code and your youtube downloader is ready.

from tkinter import *
from pytube import YouTube
import ssl

ssl._create_default_https_context = ssl._create_unverified_context

canv = Tk()
canv.geometry("400x350")
canv.title("Youtube Video Downloader")
Label(canv, text="Welcome to Youtube Downloader!!!").pack()
lvar = StringVar()
lvar.set("Enter the Youtube Video URL")
Label(canv, textvariable=lvar).pack()
url = StringVar()
Entry(canv, textvariable=url, width=30).pack(pady=10)

def download():
    try:
        lvar.set("Downloading...")
        canv.update()
        YouTube(url.get()).streams.first().download()
        lvar.set("Video Downloaded Successfully")
    except Exception as e:
        lvar.set("Error: " + str(e))
        canv.update()

Button(canv, text="Download", command=download).pack()

canv.mainloop()
Enter fullscreen mode Exit fullscreen mode

If any doubt, please comment below.

Watch the full course on Python: https://www.youtube.com/playlist?list=PLpzY0hUPKIeeRj3jOdC2YRD_MfCtBgDEe

Comments 0 total

    Add comment