我在javascript上使用Youtube API,以便从特定频道获取所有视频:
$.get(
"https://www.googleapis.com/youtube/v3/channels?",{
part : 'contentDetails',
id : '..............',
key: "..........................."},
function(data) {
............................................
});
如何使用关键字在该特定频道中搜索视频?
请改用 YouTube search:list 端点。
搜索需要channelID
和q
参数。
找到了:
function searchVideo(input) {
$.get(
"https://www.googleapis.com/youtube/v3/search",
{
q: input,
part : 'snippet',
channelId : '...........',
key: "........."
},
function(data) {
$.each( data.items, function( i, item ) {
....................
});
}
);
}
不过有一个问题。结果总是错误的。这里可能是什么情况?