Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Youtube_Video_Downloader_GUI #1368

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.