hi,下载youtube视频时pytube python模块出现错误

问题描述 投票:0回答:1

这是代码...如何解决此问题?

>>> from pytube import YouTube
>>> v=YouTube('https://www.youtube.com/watch?v=Wl2OyaZVU3U')
>>> v.title
'Maroon 5 - Memories (Lyrics)'
>>> v.streams
<pytube.query.StreamQuery object at 0x7f76859e3a20>
>>> v.download()
Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    v.download()
AttributeError: 'YouTube' object has no attribute 'download'

感谢您的帮助。

python-3.7 kali-linux
1个回答
0
投票
[库文档中有一个示例:https://github.com/nficano/pytube#getting-started

>>> YouTube('http://youtube.com/watch?v=9bZkp7q19f0').streams.first().download()

© www.soinside.com 2019 - 2024. All rights reserved.