我必须为特定 channel 更新多个视频内宣传细节。
我的要求如下:
var requestOptions={
part: 'invideoPromotion',
onBehalfOfContentOwner: 'contentOwner',
resource:{
id: channelId,
invideoPromotion: {
"defaultTiming": {
"offsetMs": 2000,
"type": "offsetFromStart"
},
"items": [
{
"promotedByContentOwner": true,
"timing":
{
"offsetMs":4000,
"duration" : 5000,
"type":"offsetFromStart"
},
"id":{
"videoId": videoid1,
"type": "video"
}
},
{
"promotedByContentOwner": true,
"timing":
{
"offsetMs":11000,
"duration" : 5000,
"type":"offsetFromStart"
},
"id":{
"videoId": videoId2,
"type": "video"
}
}
],
"position": {
"type": "corner",
"cornerPosition": "topLeft"
}
}
}
};
console.log(requestOptions);
var request = gapi.client.youtube.channels.update(requestOptions);
request.execute(function (response) {});
但是当我尝试执行此操作时,出现错误
0: {error:{code:500}, id:gapiRpc}
error: {code:500}
code: 500
id: "gapiRpc"
即使当我尝试使用youtube api资源管理器执行此操作时
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.update,
我收到内部服务器错误。
有人可以让我知道我要去哪里了。
最佳答案
您不能宣传一个以上的视频。我也尝试了相同的操作,但收到错误消息“超出了升级项目的数量”。因此,您一次只能宣传一部视频。
关于youtube - 使用YouTube API进行多个视频内宣传,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19852760/