YouTube API获取最新评论

时间:2016-09-28 14:32:12

标签: python python-2.7 youtube youtube-api

我正在为Youtube API v3使用python库,我正在尝试检索特定线程上最后一个回复的作者的名字。

现在我正在做以下事情:

video_comments = get_comments(youtube,'thread_ID')

print video_comments[0]['snippet']['authorDisplayName']

get_comments函数来自他们自己的例子,我有一个无限循环,一直在查找它。但是,我偶尔会收到此错误:

IndexError:列表索引超出范围

有关导致此问题以及如何解决问题的建议?

0 个答案:

没有答案