I used this code to download a Youtube video before 2 weeks and it worked but now when i try to run it i am getting this :
raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found
how to fix it ?
from pytube import YouTube
link=input("Enter the URL link : ")
video=YouTube(link)
video.streams.get_highest_resolution().download(output_path=r'D:\YouTubevideos')
print("Download done")
from pytube import Playlist
playlist_link=input("Enter the play list link : ")
playlist=Playlist(playlist_link)
for videos in playlist.videos:
videos.streams.get_highest_resolution().download(output_path='D:\YouTubevideos')
Upgrade your pytube package and it should be fixed. The current version is 10.8.5
pip install pytube --upgrade