MCPcopy Create free account
hub / github.com/geekcomputers/Python / download

Function download

youtubedownloader.py:13–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12# this function for Download Youtube video
13def download():
14 try:
15 url = YouTube(str(url_box.get()))
16 video = url.streams.first()
17 filename = filedialog.asksaveasfilename(
18 defaultextension=".mp4", filetypes=[("MP4 files", "*.mp4")]
19 )
20 if filename: # Check if a filename is selected
21 video.download(filename=filename)
22 messagebox.showinfo("", "Download completed!")
23 else:
24 messagebox.showwarning("", "Download cancelled!")
25 except Exception:
26 messagebox.showerror("Error", "Some Thing Went Wrong!!!\nplease try again")
27
28
29# This code runes on only this file

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
downloadMethod · 0.45

Tested by

no test coverage detected