AttributeError:“YouTube”对象没有“get_videos”属性

use*_*573 5 python youtube video download pytube

在尝试从 python 下载 YouTube 视频时,我遇到了这个错误AttributeError: 'YouTube' object has no attribute 'get_videos'

最后一行导致错误。

import pytube

link = ""
yt = pytube.YouTube(link)
videos = yt.get_videos()
Run Code Online (Sandbox Code Playgroud)

谢谢!

Val*_*lie 15

import pytube
link = "https://www.youtube.com/watch?v=mpjREfvZiDs"
yt = pytube.YouTube(link)
stream = yt.streams.first()
stream.download()
Run Code Online (Sandbox Code Playgroud)

试试上面的代码。 这里这里类似的代码不起作用。