0

this was my code

from pytube import YouTube
a=YouTube("https://www.youtube.com/watch?v=vvpb8IdDZZI")
#to print title 
print("\n")
print("******************title*****************")
print("the title is:"+a.title)

the error was

raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

but the url exists!!!and i have copied this url from browser itself and i have also upgraded my pytube

2 Answers2

0

I haven't used pytube, but the pafy module works fine for me, you can install it by writing the command "pip install pafy". Your code should look something like this:

import pafy

url = "https://www.youtube.com/watch?v=vvpb8IdDZZI"
video = pafy.new(url)

#to print title 
print("\n")
print("******************title*****************")
print("the title is:" + video.title)

You can find more information about the pafy module here: https://pypi.org/project/pafy/

Tommy Lng
  • 1
  • 2
0

Try to install pytube with:

pip install git+https://github.com/ssuwani/pytube 

And the official release has also fixed the problem.

You can get the deatils from here.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13