-1

I am getting this error HTTP Error 404: Not Found when I run this code :

from pytube import YouTube 

url = input("Paste URL:")
urll = YouTube(url)

choose = input('Choose: 4K , FHD , HD , 480p')
def D4k():
   if choose == '4K' :
      urll.streams.get_by_itag(313).downlaod()

print(D4k())

I found on internet many solutions like upgrading pytube or installing it again, but I tried that and I am using the latest version of it which is : 10.9.3 . Could anyone help me? and is there a way to stop getting this error even if its resolved.

LastFox
  • 31
  • 3

2 Answers2

0

Try using this syntax.

from pytube import YouTube
YouTube('link').streams.first().download()
yt = YouTube('link')
yt.streams
Aakarsh Kumar
  • 108
  • 2
  • 10
  • it didn't work, however this is not how I want the code to be , I don't know why they don't just fix this problem for ever – LastFox Jul 29 '21 at 10:51
0

Presently pytube Module is having error on downloading videos. Fix shall be in place soon.

Refer this to tweak your code. get_video_info YouTube endpoint suddenly returning 404 not found

For a proper fix you can try below fix https://github.com/Zeecka/pytube/tree/fix_1060

JSH
  • 119
  • 6
  • But can you explain more what to do with the second link? I downloaded the .zip file where should I extract it? . Thank you – LastFox Jul 29 '21 at 12:35
  • @LastFox Run this `pip install pkgname.zip` [link]https://stackoverflow.com/questions/30148335/install-python-module-using-a-zip-file) – JSH Jul 29 '21 at 16:34