相关疑难解决方法(0)

Pytube: urllib.error.HTTPError: HTTP 错误 410: 消失

我现在在几个程序上都遇到了这个错误。我尝试升级 pytube、重新安装它、尝试一些修复、更改 URL 和代码,但似乎没有任何效果。

from pytube import YouTube

#ask for the link from user
link = input("Enter the link of YouTube video you want to download:  ")
yt = YouTube(link)

#Showing details
print("Title: ",yt.title)
print("Number of views: ",yt.views)
print("Length of video: ",yt.length)
print("Rating of video: ",yt.rating)
#Getting the highest resolution possible
ys = yt.streams.get_highest_resolution()

#Starting download
print("Downloading...")
ys.download()
print("Download completed!!")
Run Code Online (Sandbox Code Playgroud)

这是错误代码:

from pytube import YouTube

#ask for the link from user
link = input("Enter the link of YouTube video you …
Run Code Online (Sandbox Code Playgroud)

python http http-error pytube

21
推荐指数
4
解决办法
3万
查看次数

Python使用特定的文件名下载youtube

我正在尝试通过pytube以下方式下载YouTube视频:

from pytube import YouTube
YouTube('http://youtube.com/watch?v=9bZkp7q19f0').streams.first().download()
Run Code Online (Sandbox Code Playgroud)

但该文件将具有与原始视频名称相同的名称。如何指定自定义文件名?

python youtube pytube

5
推荐指数
2
解决办法
3991
查看次数

标签 统计

python ×2

pytube ×2

http ×1

http-error ×1

youtube ×1