Pytube 给出“HTTP 错误 404:未找到"错误.有谁知道如何解决这个问题? [英] Pytube givng an "HTTP Error 404: Not Found" error. Anyone knows how to fix this?
问题描述
我在尝试使用 pytube
包从 YouTube 下载视频时遇到问题.
I'm having a problem trying to use the pytube
package to download a video from YouTube.
我收到一个 HTTP 错误 404:未找到"
错误.有人熟悉这个错误吗?我一直在尝试对此进行研究,但尚未找到导致问题的任何原因.
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!')
错误:
HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found
推荐答案
这是 一个已知错误 与 pytube
.
安装新版本的 pytube(2021 年 5 月 21 日发布)后,pip install pytube==10.8.2
或 python -m pip install --upgrade pytube
它得到了修复.
After installing a new version of pytube (released on 21 may 2021), pip install pytube==10.8.2
or python -m pip install --upgrade pytube
it got fixed.
这篇关于Pytube 给出“HTTP 错误 404:未找到"错误.有谁知道如何解决这个问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!