-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1368 from atul120212/master
Youtube_Video_Downloader_GUI
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
Program's_Contributed_By_Contributors/Python_Programs/Youtube_Video_Downloader_GUI/main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
|
||
|
Binary file added
BIN
+29.2 KB
...Contributed_By_Contributors/Python_Programs/Youtube_Video_Downloader_GUI/yt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.