2

我在 PHP 中使用 YouTube API 的第 2 版,并且已经使用了一年多。直到大约 2 周前一切正常。然后我注意到播放列表存在问题,特别是在播放列表中添加视频条目和设置位置。

根据 API 文档,我的请求标头和有效负载是正确的。我还收到一个200响应代码,在响应正文中,我的播放列表条目的yt:position值为 1。但检查播放列表的位置实际上是在末尾,而不是开头。

我想知道是否有人遇到类似的问题,他们是否找到了解决方案?

以下是我的请求/响应示例:

回复:

HTTP/1.1 200 OK
X-GData-User-Country: DE Con​​tent-
Type: application/atom+xml; 字符集=UTF-8;type=entry
GData-Version: 2.1
ETag:
Transfer-Encoding:
chunked Date: Thu, 13 Dec 2012 17:17:20 GMT
Expires: Thu, 13 Dec 2012 17:17:20 GMT
Cache-Control: private, max-age =0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; 模式=块
服务器:GSE 连接:关闭

<entry xmlns='http://www.w3.org/2005/Atom' xmlns:app='http://www.w3.org/2007/app' xmlns:media='http://search.yahoo .com/mrss/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007' gd:etag='' >
...
<yt:position> 1 </yt:position>
</entry>

要求:

PUT /feeds/api/playlists/PLAYLIST/PLAYLIST_ENTRY HTTP/1.1
接受:/
主机:gdata.youtube.com
连接:关闭
X-GData-Key:key=DEVELOPER_KEY
用户代理:Zend_Framework_Gdata/1.11.8
授权:GoogleLogin auth= AUTH_KEY
GData-Version: 2
Accept-encoding: identity
Content-Type: application/atom+xml
Content-Length: 166

<?xml version="1.0" encoding="UTF-8"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:yt="http://gdata.youtube.com /schemas/2007"><yt:position>1</yt:position></entry>

4

0 回答 0