0
如何使用Youtube Data API v3上傳帶有副標題的視頻?上傳帶副標題的視頻
該文件沒有mention什麼。
對於上傳,我使用的示例代碼與波紋管代碼:
VideoContentDetails contentDetails = new VideoContentDetails();
contentDetails.setCaption("00:00:00.105,00:00:05.413\nSubtitle 1\n\n00:00:05.667,00:00:08.750\nSubtitle 2");
videoObjectDefiningMetadata.setContentDetails(contentDetails);
我用標題的格式,this description from Youtube Data v2.
根據但當我嘗試上傳:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid value for: (.....) is not a valid value",
"reason" : "invalid"
} ],
"message" : "Invalid value for: (.....) is not a valid value"
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:423)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:46)