在尝试从python下载YouTube视频时,我遇到了此错误AttributeError: 'YouTube' object has no attribute 'get_videos'
。
最后一行会导致错误。
import pytube
link = ""
yt = pytube.YouTube(link)
videos = yt.get_videos()
谢谢!
答案 0 :(得分:4)
import pytube
link = "https://www.youtube.com/watch?v=mpjREfvZiDs"
yt = pytube.YouTube(link)
stream = yt.streams.first()
stream.download()
答案 1 :(得分:0)
from pytube import YouTube
yt = YouTube("Please copy and paste the video link here")
print(yt.title)
stream = yt.streams.first()
stream.download()