本文介绍了使用part ="...,processingDetails"时出错在youtube.videos.insert()请求中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Java 7和YouTube数据API v3进行开发.

We're developing in java 7 and YouTube Data API v3.

当我们使用"processingDetails"部分调用上传服务时,我们收到503服务不可用错误.我们做错了什么?如果我们删除它,我们就可以上传视频了.但是我们希望/需要了解ProcessingDetails.

When we are calling the upload service with "processingDetails" part, we are getting a 503 Service Unavailable Error. What are we doing wrong? If we remove it, we can upload the video just fine. But we want/need to know about processingDetails.

这是代码:

YouTube.Videos.Insert videoInsert = this.youtube.videos().insert("snippet,statistics,status,processingDetails", videoObjectDefiningMetadata, mediaContent);

其他与Google API中提供的Java客户端相同.

everything else it's the same as the java client provided in google API.

这是请求: https://www.googleapis.com/upload /youtube/v3/videos?part = snippet,statistics,status,processingDetails

这是异常堆栈跟踪:

谢谢!

推荐答案

两件事:

  1. youtube.videos.insert()请求中包含的part参数值应与您在上载元数据中指定的部分相对应.通常是snippet(因为这是包含所需标题和描述的部分),有时是status(如果您还要设置视频的公开/私有状态).在上传过程中,您无法设置statisticsprocessingDetails,因此您不应该将它们包括在零件列表中.您仍然可以通过youtube.videos.list()调用来请求statisticsprocessingDetails零件 .
  2. API应该返回一条有意义的错误消息向您解释,而不是返回通用503.我将向工程团队提交错误,请他们解决.
  1. The part parameter values you include in your youtube.videos.insert() request should correspond to the parts you're specifying in the upload metadata. Normally this would be snippet (since that's the part containing the required title and description) and sometimes status (if you're also setting the public/private status of the video). You can't set statistics or processingDetails during an upload, so you shouldn't include them in the list of parts. You can still request the statistics or processingDetails parts after the upload completes, via a youtube.videos.list() call.
  2. The API should return a meaningful error message explaining this to you instead of returning a generic 503. I'll file a bug with the engineering team asking them to take care of that.

这篇关于使用part ="...,processingDetails"时出错在youtube.videos.insert()请求中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 11:38