import pytube from moviepy.video.io.VideoFileClip import VideoFileClip
youtube = pytube.YouTube("https://www.youtube.com/watch?v=U9x0WDwMhmA")
video_stream = youtube.streams.filter(res="2160p").first()
#store your file output_file_path = "/content/sample_data/video.mp4"
video_stream.download(output_path="downloads") # creates folder
input_path_file = output_file_path
#.subclip(startseconds, endseconds) trimmedvideo = VideoFileClip(input_path_file).subclip(22,32)
trimmedvideo.write_videofile("/content/sample_data/trimmedvideo.mp4")