Advertisement
TTpocToXaKep

4K YouTube Downloader ULTRA SPEED

Feb 2nd, 2023
1,231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. # https://pastebin.com/u/TTpocToXaKep
  2. from pytube import YouTube
  3. from tkinter import *
  4.  
  5. # Get link from user
  6. link = input("Please enter a YouTube video link: ")
  7.  
  8. # Create the YouTube object
  9. yt = YouTube(link)
  10.  
  11. # Get the streams
  12. streams = yt.streams
  13.  
  14. # Create Tkinter window
  15. root = Tk()
  16.  
  17. # Set window title
  18. root.title('Download YouTube Video')
  19.  
  20. # Set window size
  21. root.geometry('500x500')
  22.  
  23. # Create function for each stream
  24. def one():
  25.     streams[0].download()
  26.  
  27. def two():
  28.     streams[1].download()
  29.  
  30. def three():
  31.     streams[2].download()
  32.  
  33. def four():
  34.     streams[3].download()
  35.  
  36. def five():
  37.     streams[4].download()
  38.  
  39. # Create download buttons
  40. btn1 = Button(root, text=streams[0], command=one).pack()
  41. btn2 = Button(root, text=streams[1], command=two).pack()
  42. btn3 = Button(root, text=streams[2], command=three).pack()
  43. btn4 = Button(root, text=streams[3], command=four).pack()
  44. btn5 = Button(root, text=streams[4], command=five).pack()
  45.  
  46. # Run the window
  47. root.mainloop()
  48. # https://pastebin.com/u/TTpocToXaKep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement