Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在尝试从 python 下载 YouTube 视频时,我遇到了这个错误AttributeError: 'YouTube' object has no attribute 'get_videos'。
AttributeError: 'YouTube' object has no attribute 'get_videos'
最后一行导致错误。
import pytube link = "" yt = pytube.YouTube(link) videos = yt.get_videos()
谢谢!
import pytube link = "https://www.youtube.com/watch?v=mpjREfvZiDs" yt = pytube.YouTube(link) stream = yt.streams.first() stream.download()
试试上面的代码。 这里和这里类似的代码不起作用。
from pytube import YouTube yt = YouTube("Please copy and paste the video link here") print(yt.title) stream = yt.streams.first() stream.download()