我試圖更新scala中的LiveBroadcast的隱私狀態(使用java jdk)。這是我的工作流程:更新YouTube的直播流隱私狀態
與private
隱私狀態
val snippet = new LiveBroadcastSnippet()
.setTitle(title)
.setScheduledStartTime(YouTubeDateTime.now())
.setChannelId(channel.getId)
val status = new LiveBroadcastStatus()
.setPrivacyStatus("private")
val broadcast = new LiveBroadcast()
.setKind("youtube#liveBroadcast")
.setSnippet(snippet)
.setStatus(status)
val request = youtube.liveBroadcasts()
.insert("snippet,status,contentDetails", broadcast)
request.execute
轉型LiveBroadcast到testing
(IFF綁定的視頻直播活動是活動的)
val request = youtube.liveBroadcasts
.transition(lifeCycleStatus.toString, broadcast.getId, "status")
request.execute
一旦高興與流創建LiveBroadcast,設置LiveBroadcast隱私保護至public
val status = new LiveBroadcastStatus().setPrivacyStatus("public")
broadcast.setStatus(status)
val request = youtube.liveBroadcasts.update("status", broadcast)
request.execute()
最後一部分不工作,而是返回400響應:
400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "youtube.part",
"location" : "part",
"locationType" : "parameter",
"message" : "{0}",
"reason" : "unexpectedPart"
} ],
"message" : "{0}"
}
做同樣的要求here的作品,所以我不知道我做錯了。
任何人都可以幫忙嗎?