【发布时间】:2016-05-29 21:22:41
【问题描述】:
我正在尝试通过 API 评论和评价评论,但资源总是
canRate: false 和 canReply: false
一世
我已经尝试通过 google javascript 客户端和 http get 请求,但似乎没有任何效果。
$http.get('https://www.googleapis.com/youtube/v3/commentThreads', {
params: {
key: API_KEY,
part: 'snippet',
textFormat: 'plainText',
videoId: VIDEO_ID,
order: 'relevance'
}
}).success(function(response) {
$scope.comments = response.items;
$log.debug($scope.comments);
//var author = item.snippet.topLevelComment.snippet.authorDisplayName;
//var comment = item.snippet.topLevelComment.snippet.textDisplay;
//var nextToken = results.nextPageToken;
//var totalRep = item.snippet.totalReplyCount;
//var parent = item.snippet.topLevelComment.id;
})
.error(function(error) {
$log.error(error);
})
这就是我正在使用的,我可以完美地列出它们(即使使用v3/comments)但不能回复也不能评价评论,这就是我正在使用的
gapi.client.load('youtube', 'v3', function () {
$scope.selectedComment.snippet.viewerRating = 'like';
var request = gapi.client.youtube.commentThreads.update({
part: "snippet",
body: $scope.selectedComment
});
request.execute(function(response) {
$log.debug(response);
});
});
在body 部分,我也试过这个
body: {
id: $scope.selectedCommentId,
'snippet': {
'viewerRating': 'like'
}
}
但我得到了这个错误
404 找不到指定的评论线程。检查值
id属性的 请求正文以确保其正确
【问题讨论】:
标签: javascript youtube google-api