AttributeError: 'YouTube' object has no attribute 'get_videos'

我是研究僧i 提交于 2020-07-07 01:07:19

问题


While trying to download a YouTube video from python, I come across this error AttributeError: 'YouTube' object has no attribute 'get_videos'.

Last line causes the error.

import pytube

link = ""
yt = pytube.YouTube(link)
videos = yt.get_videos()

Thanks!


回答1:


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

Try above code. Here and here similar code which does not work.




回答2:


from pytube import YouTube
yt = YouTube("Please copy and paste the video link here")
print(yt.title)
stream = yt.streams.first()
stream.download()


来源:https://stackoverflow.com/questions/49643206/attributeerror-youtube-object-has-no-attribute-get-videos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!