Skip to content

Commit

Permalink
Merge pull request #1368 from atul120212/master
Browse files Browse the repository at this point in the history
Youtube_Video_Downloader_GUI
  • Loading branch information
fineanmol authored Sep 30, 2022
2 parents ef35cba + f817f61 commit aeebde0
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from kivymd.app import MDApp
from kivymd.uix.label import MDLabel
from kivymd.uix.behaviors import SpecificBackgroundColorBehavior
from tkinter import *
from tkinter import filedialog
from pytube import YouTube
from moviepy import *
from moviepy.editor import VideoFileClip

#functions
def select_path():
#allows user to select a path from the explore
path=filedialog.askdirectory()
path_label.config(text=path)

def download_file():
# get user path
get_link=link_field.get()
#get selected path
user_path=path_label.cget("text")
#Download video
mp4_Video = YouTube(get_link).streams.get_highest_resolution().download()
vid_clip = VideoFileClip(mp4_Video)
vid_clip.close()



screen =Tk()
title = screen.title('Youtube Downloader')
canvas = Canvas(screen, width=500, height=500)
canvas.pack()

#image_logo
logo_img = PhotoImage(file="yt.png")

#resize
logo_img = logo_img.subsample(2,2)
canvas.create_image(250, 80, image=logo_img)


link_field = Entry(screen, width=50)
link_label = Label(screen, text='Enter Download Link:', font=('Arial', 15))

#select for saving the file
path_label = Label(screen, text="Select path for Download", font=('Arial', 15))
select_btn = Button(screen, text='Select', command=select_path)

#Add to window
canvas.create_window(250, 280, window=path_label)
canvas.create_window(250, 330, window=select_btn)



#Add widgets to windows
canvas.create_window(250, 170, window=link_label)
canvas.create_window(250, 220, window=link_field)

#Download btns

download_btn = Button(screen, text="Download File", command=download_file)

#add to canvas
canvas.create_window(250, 390, window=download_btn)



screen.mainloop()


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aeebde0

Please sign in to comment.