0

我正在尝试获取用户上传的完整视频列表。

我正在使用以下网址:

https://gdata.youtube.com/feeds/api/users/username/uploads?v2&alt=json

并在 php 中使用 curl 来获取内容。

但我只得到 25 个结果。如果我使用最大结果,最大值为 50。

我应该使用什么来获取整个列表?

4

2 回答 2

1

After replacing 'username' with a valid name the response shows a url link for the next request in the response you get. Look for: {"rel":"next","type":"application/atom+xml","href":"https://gdata.youtube.com/feeds/api/users/username/uploads?alt=json&start-index=26&max-results=25"} As you can see another parameter is added: 'start-index'. Which you also can add yourself

BTW. I assume you know there is a typing error in your example. You set the version parameter by using 'v=2' instead of 'v2'.

于 2013-04-29T11:20:34.167 回答
0

为此,我建议使用YouTube Data API v3 。您可以在YouTube API Samples项目中使用PHP 示例。

于 2013-04-30T20:25:09.820 回答