【发布时间】:2020-11-19 07:07:47
【问题描述】:
我在使用 YouTube 时遇到了 pytube 问题
from pytube import YouTube
url = str(input("Youtube video url :"))
youtube = YouTube(url)
stream = youtube.streams()
video.download(0)
这个错误显示
AttributeError: 'YouTube' object has no attribute 'download'
当我使用播放列表时
from pytube import Playlist
playlist = Playlist('https://www.youtube.com/playlist?list=PLRfY4Rc-GWzhdCvSPR7aTV0PJjjiSAGMs')
print('Number of videos in playlist: %s' % len(playlist.video_urls))
playlist.download_all()
显示同样的错误
AttributeError: 'Playlist' object has no attribute 'download_all'
【问题讨论】: