Getting the title of youtube video in pytube3?

匆匆过客 提交于 2020-07-22 06:06:13

问题


I am trying to build an app to download YouTube videos in python using pytube3.
But I am unable to retrieve the title of the video.
Here goes my code:

from pytube import YouTube
yt = YouTube(link)
print(yt.title)

No matter whatever is the link I always get the title returned as YouTube instead of title of the video. Is there anyway to fix it?


回答1:


try this instead

yt.streams[0].title

or

yt.streams[0].default_filename


来源:https://stackoverflow.com/questions/62652157/getting-the-title-of-youtube-video-in-pytube3

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