├── requirements.txt ├── .idea ├── .gitignore ├── misc.xml ├── vcs.xml ├── inspectionProfiles │ ├── profiles_settings.xml │ └── Project_Default.xml ├── modules.xml └── Advance_YouTube_Downloader.iml ├── meta ├── yt.ico ├── down.png ├── insta.ico ├── ylogo.png ├── eraser.png ├── search.png └── download.png ├── Screenshot (73).png ├── Screenshot (74).png ├── README.md └── YT_GUI.py /requirements.txt: -------------------------------------------------------------------------------- 1 | pafy 2 | Pillow -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /meta/yt.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Advance_YouTube_Downloader/HEAD/meta/yt.ico -------------------------------------------------------------------------------- /meta/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Advance_YouTube_Downloader/HEAD/meta/down.png -------------------------------------------------------------------------------- /meta/insta.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Advance_YouTube_Downloader/HEAD/meta/insta.ico -------------------------------------------------------------------------------- /meta/ylogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Advance_YouTube_Downloader/HEAD/meta/ylogo.png -------------------------------------------------------------------------------- /meta/eraser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Advance_YouTube_Downloader/HEAD/meta/eraser.png -------------------------------------------------------------------------------- /meta/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Advance_YouTube_Downloader/HEAD/meta/search.png -------------------------------------------------------------------------------- /Screenshot (73).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Advance_YouTube_Downloader/HEAD/Screenshot (73).png -------------------------------------------------------------------------------- /Screenshot (74).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Advance_YouTube_Downloader/HEAD/Screenshot (74).png -------------------------------------------------------------------------------- /meta/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spidy20/Advance_YouTube_Downloader/HEAD/meta/download.png -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/Advance_YouTube_Downloader.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Advance YouTube Video Downloader 2 | 3 | [![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/) 4 | [![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)](https://www.python.org/downloads/release/python-360/) 5 | 6 | ## [Follow us on Instagram for Machine Learning Guidelines & Path](https://www.instagram.com/machine_learning_hub.ai/) 7 | ## [Buy Python & ML projects for students at lower rate](https://www.instamojo.com/kushalbhavsar1820) 8 | ## [Watch Tutorial for this project](https://youtu.be/c1CzR_4koBQ) 9 | 10 | [![Watch Tutorial here](https://img.youtube.com/vi/c1CzR_4koBQ/0.jpg)](https://www.youtube.com/watch?v=c1CzR_4koBQ) 11 | 12 | ## Features:- 13 | - Simple GUI 14 | - Less lines of codes(Only 200) 15 | - You can fetch the Title & Duration of any YouTube video. 16 | - You can download the Thumbnail of video. 17 | - You will get three options for downloading 18 | `Video with Sound` 19 | `Video(No Sound) with Highest quality` 20 | `Audio Only` 21 | - Higher speed downloads 22 | 23 | ## Usage:- 24 | 25 | - Clone my repository. 26 | - Open CMD in working directory. 27 | - Run `pip install -r requirements.txt` 28 | - Run `YT_GUI.py` for launching application, it is very simple GUI application. 29 | - For explanation of project see the tutorial on Machine Learning Hub YouTube channel. 30 | 31 | ## Screenshots 32 | 33 | 34 | 35 | 36 | ## Just follow☝️ me and Star⭐ my repository 37 | 38 | # [Buy me a Coffee☕](https://www.buymeacoffee.com/spidy20) 39 | ## [Donate me on PayPal(It will inspire me to do more projects)](https://www.paypal.me/spidy1820) 40 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 52 | -------------------------------------------------------------------------------- /YT_GUI.py: -------------------------------------------------------------------------------- 1 | from PIL import ImageTk 2 | import PIL.Image 3 | from tkinter import * 4 | from tkinter import ttk 5 | import tkinter as tk 6 | import pafy 7 | import io 8 | from urllib.request import urlopen 9 | 10 | windo = Tk() 11 | windo.configure(background='white') 12 | windo.title("YouTube Video Downloader") 13 | 14 | windo.geometry('1120x520') 15 | windo.iconbitmap('./meta/yt.ico') 16 | windo.resizable(0, 0) 17 | 18 | 19 | def get_info(): 20 | global video,lc,im5 21 | link_vid = txt2.get() 22 | try: 23 | video = pafy.new(link_vid) 24 | except Exception as e: 25 | error = tk.Label(windo, text="Something went wrong!! Please check URL", width=35, height=2, fg="white", bg="red", 26 | font=('times', 18, ' bold ')) 27 | error.place(x=274, y=370) 28 | windo.after(5000, destroy_widget, error) 29 | print(e) 30 | 31 | ## Set Video Title 32 | v_name = video.title 33 | video_title.config(text="Name: "+ v_name,width=80) 34 | video_title.place(x=50, y=300) 35 | 36 | ## Set Duration 37 | dura = video.duration 38 | video_dur.config(text="Time: " +dura,width=17) 39 | video_dur.place(x=50, y=330) 40 | 41 | ## Get the Thumbnail of Video 42 | thumb = video.bigthumb 43 | print(thumb) 44 | u = urlopen(thumb) 45 | raw_data = u.read() 46 | im5 = PIL.Image.open(io.BytesIO(raw_data)) 47 | im5_resized = im5.resize((240, 150), PIL.Image.ANTIALIAS) 48 | 49 | image = ImageTk.PhotoImage(im5_resized) 50 | panel50 = Label(windo, image=image, borderwidth=0) 51 | panel50.image = image 52 | panel50.pack() 53 | panel50.place(x=881, y=90) 54 | 55 | ## Download button of Thumbnail 56 | im7 = PIL.Image.open('./meta/download.png') 57 | im7 = im7.resize((40, 40), PIL.Image.ANTIALIAS) 58 | sp_img7 = ImageTk.PhotoImage(im7) 59 | panel8 = Button(windo, borderwidth=0,command = download_video_thumbnail, image=sp_img7, bg='white') 60 | panel8.image = sp_img7 61 | panel8.pack() 62 | panel8.place(x=985, y=245) 63 | 64 | dow_list = ["Choose Format", "Video with Sound","Video(No Sound)", "Audio Only"] 65 | lc = ttk.Combobox(windo, width=16, state="readonly") 66 | lc.pack() 67 | lc['values'] = dow_list 68 | lc.current(0) 69 | lc.place(x=280, y=234) 70 | 71 | lc.bind("<>", quality_choose) 72 | 73 | def destroy_widget(widget): 74 | widget.destroy() 75 | 76 | def download_video_thumbnail(): 77 | try: 78 | vid_id = video.videoid 79 | im5.save(vid_id+'.jpg') 80 | msg = tk.Label(windo, text='Thumbnail Downloaded', width=25, height=2, fg="white", bg="midnightblue", 81 | font=('times', 18, ' bold ')) 82 | msg.place(x=274, y=370) 83 | windo.after(5000, destroy_widget, msg) 84 | except Exception as e: 85 | print(e) 86 | 87 | def quality_choose(event): 88 | global lc1,best,down_qual 89 | cho = lc.get() 90 | if cho == "Video with Sound": 91 | down_qual = video.streams 92 | best = list(video.streams) 93 | best.insert(0, '--Select Quality--') 94 | for i, s in enumerate(best): 95 | best[i] = str(s).replace('normal:', '') 96 | lc1 = ttk.Combobox(windo, width=18, state="readonly") 97 | lc1.pack() 98 | lc1['values'] = best 99 | lc1.current(0) 100 | lc1.place(x=430, y=234) 101 | 102 | if cho == "Video(No Sound)": 103 | down_qual = video.videostreams 104 | best = list(video.videostreams) 105 | best.insert(0,'Select Video Quality') 106 | for i, s in enumerate(best): 107 | best[i] = str(s).replace('video:','') 108 | 109 | lc1 = ttk.Combobox(windo, width=18, state="readonly") 110 | lc1.pack() 111 | lc1['values'] = best 112 | lc1.current(0) 113 | lc1.place(x=430, y=234) 114 | 115 | if cho == "Audio Only": 116 | down_qual = video.audiostreams 117 | best = list(video.audiostreams) 118 | best.insert(0, 'Select Audio Quality') 119 | for i, s in enumerate(best): 120 | best[i] = str(s).replace('audio:','') 121 | lc1 = ttk.Combobox(windo, width=18, state="readonly") 122 | lc1.pack() 123 | lc1['values'] = best 124 | lc1.current(0) 125 | lc1.place(x=430, y=234) 126 | 127 | lc1.bind("<>", download_button) 128 | 129 | def download_button(event): 130 | im7 = PIL.Image.open('./meta/down.png') 131 | im7 = im7.resize((140,43), PIL.Image.ANTIALIAS) 132 | sp_img7 = ImageTk.PhotoImage(im7) 133 | panel8 = Button(windo,command = download_vid, borderwidth=0, image=sp_img7, bg='white') 134 | panel8.image = sp_img7 135 | panel8.pack() 136 | panel8.place(x=580, y=223) 137 | 138 | def download_vid(): 139 | try: 140 | choice_qual = lc1.get() 141 | ind = int(best.index(choice_qual)) 142 | new_ind = ind-1 143 | selected_qual = down_qual[new_ind] 144 | selected_qual.download() 145 | msg = tk.Label(windo, text='Stream Downloaded', width=25, height=2, fg="white", bg="midnightblue", 146 | font=('times', 18, ' bold ')) 147 | msg.place(x=274, y=370) 148 | windo.after(4000, destroy_widget, msg) 149 | 150 | except Exception as e: 151 | error = tk.Label(windo, text="Something went wrong!!", width=27, height=2, fg="white", bg="red", 152 | font=('times', 18, ' bold ')) 153 | error.place(x=274, y=370) 154 | windo.after(5000, destroy_widget, error) 155 | print(e) 156 | 157 | def clear(): 158 | txt2.delete(first=0,last=100) 159 | 160 | im = PIL.Image.open('./meta/ylogo.png') 161 | im = im.resize((200, 200), PIL.Image.ANTIALIAS) 162 | wp_img = ImageTk.PhotoImage(im) 163 | panel4 = Label(windo, image=wp_img, bg='white') 164 | panel4.pack() 165 | panel4.place(x=50, y=70) 166 | 167 | im1 = PIL.Image.open('./meta/search.png') 168 | im1 = im1.resize((40, 40), PIL.Image.ANTIALIAS) 169 | sp_img = ImageTk.PhotoImage(im1) 170 | panel5 = Button(windo, borderwidth=0,command = get_info, image=sp_img, bg='white') 171 | panel5.pack() 172 | panel5.place(x=750, y=175) 173 | 174 | im2 = PIL.Image.open('./meta/eraser.png') 175 | im2 = im2.resize((40, 40), PIL.Image.ANTIALIAS) 176 | sp_img1 = ImageTk.PhotoImage(im2) 177 | panel6 = Button(windo, borderwidth=0,command=clear, image=sp_img1, bg='white') 178 | panel6.pack() 179 | panel6.place(x=810, y=175) 180 | 181 | 182 | pred = tk.Label(windo, text="YouTube Video Downloader", width=30, height=2, fg="white", bg="maroon2", 183 | font=('times', 25, ' bold ')) 184 | pred.place(x=274, y=10) 185 | 186 | lab = tk.Label(windo, text="Enter your URL", width=18, height=1, fg="white", bg="blue2", 187 | font=('times', 16, ' bold ')) 188 | lab.place(x=394, y=120) 189 | 190 | txt2 = tk.Entry(windo, borderwidth=7, width=43, bg="white", fg="black", font=('times', 15, ' bold ')) 191 | txt2.place(x=280, y=170) 192 | # txt2.insert(tk.END, 'https://www.youtube.com/watch?v=p_dtI2bLWhY&list=RDMMgkCKTuR-ECI&index=7') 193 | 194 | video_title = tk.Label(windo, width=10, height=1, fg="black", bg="spring green", 195 | font=('times', 15, ' bold ')) 196 | 197 | video_dur = tk.Label(windo, width=10, height=1, fg="white", bg="dark violet", 198 | font=('times', 15, ' bold ')) 199 | 200 | windo.mainloop() --------------------------------------------------------------------------------