I'm trying to rename my downloaded Pytube video but when I try to change the filename, the file extension changes from mp4 to file.
Here's my code:
yt = YouTube("https://youtu.be/Igo8pUqvFMc")
stream_type = int(input("Types: \n1. Video only \n2. Audio only \n3. Video awith audio \nEnter the number of the type you want to download: "))
if stream_type == 1:
videos = yt.streams.filter(only_video=True, adaptive=True, file_extension="mp4")
vid = list(enumerate(videos))
for i in vid:
print(i)
stream_no = int(input("Enter: "))
videos[stream_no].download(filename=yt.title + " VIDEO ONLY")