#6: software to download youtube videos
Software to download YouTube videos(Tkinter)
Hello guys, In this article I am going to show you free software to download YouTube videos. This software is build using python tkinter library so it is safe. This software is very easy to use and its interface is also user friendly. This software does not contain any type of virus or ads, which proves dangerous for your device. This software is only for windows users not for Linux.
Stay updated for new versions of this software in future. So please give us feedback about this software so that we can improve its performance and develop it according to user friendly interface.
How to download?
If you want to download this software click on the download text below . This will take you to the google drive link and from there you can download this software.
How to Install?
After downloading is completed you got an exe file named My_setup so it is final software double click on it and install. After installing you will get a icon on your desktop name as Youdownloader . Double click on the icon and anjoy the software.
How to use?
Follow the following steps to use this software
- Double click on the icon of the software name you downloader
- Then copy the link of video you want to download from youtube and paste in it
- Choose the location where you want to save the video
- Click on download button wait for some time and you got an alert when video is downloaded
Note = This software is in the beginning state and in the future i will develop it and add more features in it. and all the versions will be available on this site.
code for software
*******************************
# If you will be going to copy this code to use programme then please make two png file by name 1.png and 2.png for icon and label image, in your directory in which your code editor is running . If you don't
do this then this programme will give error that files 1.png and 2.png not found
# Importing some Modules used to make proeject
from tkinter import *
from tkinter import filedialog
from pytube import YouTube
import pyautogui
# Setting the window
root = Tk()
root.geometry('800x500')
root.minsize(800,500)
root.maxsize(800,500)
ls = [] # Empty list for that: when user can choose directory the path will be append in it and we can use this path in download video func as ls[0] because it has only one element and after the downloading we clear the list
def youtube_download():
'''This is used to download the video and error handling'''
url_var = urlvalue.get()
z = False
try: # if url is correct then z = True and due to this 39 line code will run and video will download because if we cannot use condition in line 39 . then if user url is incorrect so execpt block will be run but try block will not be ran so the 'a' inside try block will not be declared and without condition if we use the code of lin 39 then it will try to download video a.streams.first().download(n) and raise error because a is not declared because try block is not ran. So we use the condition if try block ran then line 39 will exicute
global a
a = YouTube(url_var)
z = True
except: # handling error if user url is empty or not found
pyautogui.alert('URL not found !')
urlvalue.set('')
if len(ls)==0 : # Error handling of there is no directory choosen becaue of empty list
pyautogui.alert('Please choose Location !')
else:
n = ls[0]
n = n.replace('/','\\') # Replacing the character / in url path to \ because download will use \
print(n)
if z==True: #it will exicute only if try block will be ran due to conditon . This code download the video and clear the entry widget as well as list
a.streams.first().download(n)
pyautogui.alert(' Video Downloaded Successfully \n at Location {}'.format(n))
urlvalue.set('')
ls.clear()
root.destroy()
def ask_for_dir():
'''This Function is used to ask the user for choose the path'''
location = filedialog.askdirectory()
print(location)
ls.append(location)
#setting the icon and title of window
root.title('Youtube video downloader')
photo = PhotoImage(file='1.png')
root.iconphoto(False,photo)
# Setting image Label header
head = Label(root,text='Download Youtube videos easily',font='Arial 25 bold',fg='red')
head.pack()
photo1 = PhotoImage(file='2.png')
image_label = Label(root,image=photo1)
image_label.pack()
#Setting url label and entry tag
url = Label(root,text='Enter URL: ',font='Arial 15 bold')
url.pack()
urlvalue = StringVar()
urlentry = Entry(root,textvariable=urlvalue,width=70,bd=4,relief=GROOVE)
urlentry.pack(pady=10,padx=100)
#Button for chosing files
file_chooe = Button(root,text='Choose Location',command=ask_for_dir,bd=2,
relief=RIDGE,font='Arial 9 bold',height=1,width=15,bg='black',fg='white')
file_chooe.pack(pady=10)
# Submit Botton
b = Button(root,text='Download',font='Arial 13 bold',bg='grey',bd=2,relief=RIDGE,command=youtube_download,height=1,width=9)
b.pack(pady=20)
root.mainloop()
*******************************
Comments
Post a Comment