Damoiskii
Damoiskii

Reputation: 1370

Pytube givng an "HTTP Error 404: Not Found" error. Anyone knows how to fix this?

I'm having a problem trying to use the pytube package to download a video from YouTube.

I'm getting a "HTTP Error 404: Not Found" error. Is anyone familiar with this error? I've been trying to research about this but yet to find anything that causes the problem.

I will share my code and the error below:

from pytube import YouTube

video = YouTube("https://youtu.be/sflWFZKFJgk")

print(video.title)
print("downloading...")

video.streams.get_highest_resolution().download()

print('Downloaded successfully!')

The error:

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

Upvotes: 1

Views: 5025

Answers (4)

Rishabh Bhardwaj
Rishabh Bhardwaj

Reputation: 338

This was a known bug with pytube.

python -m pip install --upgrade pytube it got fixed.

Upvotes: 10

Rene Smit
Rene Smit

Reputation: 61

Version 10.8.5 solves the problem. Upgrade with

python -m pip install --upgrade pytube

Upvotes: 2

Marcio Branco
Marcio Branco

Reputation: 1

Someone here was successful using the latest version of pytube. I already did all steps of https://pypi.org/project/pytube/ and https://github.com/nficano/pytube but still with error _execute_request

Have you already tested it on Python 3.8.5?

Upvotes: 0

shailu
shailu

Reputation: 330

first uninstall the pytube

python -m pip uninstall pytube pytube3 pytubex

and install latest one

python -m pip install git+https://github.com/nficano/pytube

Upvotes: 0

Related Questions