【问题标题】:GDATA and youtube, Get all videos on a playlistGDATA 和 youtube,获取播放列表中的所有视频
【发布时间】:2012-04-25 09:00:32
【问题描述】:

有人知道如何从播放列表中获取所有视频吗?

例如来自这个播放列表

https://gdata.youtube.com/feeds/api/playlists/454A0274C1223C90?v=2

上限为 10 个结果

我尝试了 &max-results=1000 但那个 404'ed

【问题讨论】:

    标签: api gdata


    【解决方案1】:

    尝试一次询问 50 个结果(最多允许)

    GET /feeds/api/playlists/454A0274C1223C90?v=2&&max-results=100&fields=entry/id,entry/title&key=4{your-key} HTTP/1.1
    Host: gdata.youtube.com
    Authorization: OAuth ya29.AHES6ZQMwDjrUKh8RLysv-ZzF3DaUmg0XmG0jtVcWdSA0A
    HTTP/1.1 400 Bad Request
    status: 400
    content-length: 246
    x-xss-protection: 1; mode=block
    x-content-type-options: nosniff
    expires: Sat, 28 Apr 2012 16:29:01 GMT
    x-google-cache-control: remote-fetch
    server: GSE
    via: HTTP/1.1 GWA
    x-gdata-user-country: US
    cache-control: private, max-age=0
    date: Sat, 28 Apr 2012 16:29:01 GMT
    x-frame-options: SAMEORIGIN
    content-type: application/vnd.google.gdata.error+xml
    -content-encoding: gzip
    <errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>InvalidRequestUriException</code><internalReason>Max-results value is too high. Only up to 50 results can be returned per query.
    
    
    GET /feeds/api/playlists/454A0274C1223C90?v=2&&max-results=50&fields=entry/id,entry/title&key=${key} HTTP/1.1
    Host: gdata.youtube.com
    Authorization: OAuth ya29.AHES6ZQMwDjrUKh8RLysv-ZzF3DaUmg0XmG0jtVcWdSA0A
    HTTP/1.1 200 OK
    status: 200
    gdata-version: 2.1
    content-length: 6703
    via: HTTP/1.1 GWA
    content-location: https://gdata.youtube.com/feeds/api/playlists/454A0274C1223C90?v=2&&max-results=50&fields=entry/id,entry/title&key=w1Q
    x-content-type-options: nosniff
    expires: Sat, 28 Apr 2012 16:32:08 GMT
    vary: Accept, X-GData-Authorization, GData-Version
    x-google-cache-control: remote-fetch
    server: GSE
    last-modified: Sat, 28 Apr 2012 10:46:07 GMT
    x-xss-protection: 1; mode=block
    etag: W/"A04CRn47eCp7I2A9WhVWFk0."
    cache-control: private, max-age=300, no-transform
    date: Sat, 28 Apr 2012 16:32:08 GMT
    x-frame-options: SAMEORIGIN
    content-type: application/atom+xml; charset=UTF-8; type=feed
    -content-encoding: gzip
    x-gdata-user-country: US
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-18
      • 2015-08-20
      • 2016-11-19
      • 1970-01-01
      • 2016-10-25
      • 1970-01-01
      相关资源
      最近更新 更多