def get_video_info(url):
"""
Retrieve the YouTube videos' information without downloading it.
Source: http://stackoverflow.com/questions/18054500/how-to-use-youtube-dl-\
from-a-python-programm/18947879#18947879
"""
ydl = youtube_dl.YoutubeDL()
ydl.add_default_info_extractors()
try:
return ydl.extract_info(url, download=False)
except youtube_dl.DownloadError:
return None
评论列表
文章目录