我一直在尝试将字幕插入 YouTube 上的现有视频中。我能够毫无问题地调用列表标题端点。所以这不是 Auth 问题。
我调用了 POST https://www.googleapis.com/youtube/v3/captions?part=snippet
带有请求正文
{
"snippet": {
"language": "en",
"name": "English captions",
"videoId": "MY_VIDEO_ID",
"isDraft": true
}
}
Run Code Online (Sandbox Code Playgroud)
但我收到“请求不包含字幕轨道内容”。
https://developers.google.com/youtube/v3/docs/captions/insert
google api explorer 不会向您展示如何在请求中实际附加标题文件。
我也尝试使用表单数据发布,但没有成功。
我正在寻找一种方法,一旦条件满足就停止迭代正内循环.我想过使用"继续",但它没有做我想要的."break"似乎打破了整个循环,包括外循环.
所以在我的代码中,一旦满足条件.我想停止迭代j,但我想再次开始迭代.谢谢,
for i in 0..<sortedArray.count{
for j in 1..<sortedArray.count{
if sortedArray[j] == sortedArray[i]{
//I want to skip iterating inner loop j from now. and back to iterating i
}
}
}
Run Code Online (Sandbox Code Playgroud)