pastebin

Paste Search Dynamic
Recent pastes
download Video
  1. from pytube import YouTube
  2.  
  3. def download_Video(yt):
  4.   # filter mp4 streams from object
  5.   my_streams = yt.streams.filter(file_extension='mp4',only_video=true)
  6.   for streams in my_streams:
  7.     # print itag, resolution and codec format of Mp4 streams
  8.     print(f"Video itag : {streams.itag} Resolution : {streams.resolution} VCodec : {streams.codecs[0]}")
  9.    
  10.    
  11.   # enter the itag value of resolution on which you want to download the video
  12.   input_itag = input("Enter itag Value : ")
  13.   # get video using itag vale
  14.   video = yt.streams.get_by_itag(input_itag)
  15.  
  16.   # finally download the YouTube Video...
  17.   video.download()
  18.   print("Video is Downloading as",yt.title+".mp4")
  19.  
  20. link = "Enter Your Link Here"
  21. # Create YouTube Object.
  22. yt = YouTube(link)
  23.  
  24. # call The function..
  25. download_video(yt)
Parsed in 0.031 seconds