1

我正在尝试使用 GData for ObjectiveC 从 iPhone“已安装的应用程序”将视频上传到 youtube。

目前,我在上传票证上收到错误:ServiceException - 错误代码 500。

从文档中我无法弄清楚这个错误的含义以及我做错了什么:

500(内部错误)- 500 响应代码表示 YouTube 在处理请求时遇到错误。您可以稍后重试该请求。

我在一周多的时间内只收到了这个错误(所以这不是暂时的中断),我已经尝试过为 Youtube API 注册不同的产品。

谁能在我的请求中发现我做错了什么?

您可以在下面找到来自 GData 的 GTMHttpDebugLogs 的日志:

uploadTicket:finishedWithEntry:error:

2012-10-18 17:13:26 +0000
Request: POST https://uploads.gdata.youtube.com/resumable/feeds/api/users/default/uploads
Request headers:
  Accept: application/atom+xml, text/xml
  Authorization: AuthSub token=<authorization subtoken refreshed every time>
  Cache-Control: no-cache
  Content-Length: 793
  Content-Type: application/atom+xml; charset=utf-8
  GData-Version: 2.0
  Slug: video-filename.mp4
  User-Agent: <bundle>/2.0.0 GData-ObjectiveC/1.12 iPhone/5.1 (gzip)
  X-GData-Key: key=<my developer key
  X-Upload-Content-Length: 4005670
  X-Upload-Content-Type: video/mp4

Request body: (793 bytes)
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gml="http://www.opengis.net/gml" xmlns:app="http://www.w3.org/2007/app" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:media="http://search.yahoo.com/mrss/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:yt="http://gdata.youtube.com/schemas/2007"><yt:accessControl action="list"/><media:group><media:description>Video description here</media:description><media:keywords/><media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Music</media:category><media:title>Video title here</media:title></media:group></entry>


Response: status 500
Response headers:
  Cache-Control: no-cache, no-store, must-revalidate
  Content-Length: 171
  Content-Type: application/vnd.google.gdata.error+xml
  Date: Thu, 18 Oct 2012 17:13:19 GMT
  Expires: Fri, 01 Jan 1990 00:00:00 GMT
  Pragma: no-cache
  Server: HTTP Upload Server Built on Oct 3 2012 16:52:30 (1349308350)
  X-GData-User-Country: US
  X-GUploader-UploadID: <### I made this upload id anonymous ###>

Response body: (171 bytes)
<errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>ServiceException</code><internalReason>Internal Error</internalReason></error></errors>
-----------------------------------------------------------
4

1 回答 1

0

这是由<yt:accessControl action="list"/>您的请求引起的,该请求不是有效值。它应该是这样的<yt:accessControl action='list' permission='denied'/>

话虽如此,API 应该优雅地处理这个问题,而不是返回内部服务器错误。我将在内部向相关人员提交一个错误以解决该问题。

于 2012-10-19T21:11:04.270 回答