3

我有一个包含 500 多个视频的频道,并且想要我的频道中所有视频 URL 的列表。

我努力了:

https://gdata.youtube.com/feeds/api/users/default/uploads?key=DEVELOPER_KEY

开发者密钥来自:https ://code.google.com/apis/youtube/dashboard

我只是得到: 需要用户身份验证。错误 401

不知道如何进行。

4

2 回答 2

1

https://gdata.youtube.com/feeds/api/users/your_youtube_username/uploads?max-results=50&start-index=1&prettyprint=true&fields=entry(title,media:group(media:player(@url)))

Sunxperous 代码中的一些更改。

最大结果的最大查询

插入$prettyprint看更漂亮

过滤数据,只会看到标题和 URL。

查看更多

https://developers.google.com/youtube/2.0/developers_guide_protocol_api_query_parameters#max-resultssp

于 2013-05-15T21:58:51.190 回答
0

https://gdata.youtube.com/feeds/api/users/your_youtube_username/uploads?max-query=50&start-index=51

Replace default with your YouTube username. This GET request does not seem to require a developer key.

YouTube API v2.0 - API Query Parameters describes the use of the max-query search parameter. As it will only return a maximum of 50 results, use it with start-index to determine the range of the requested results. The sample link above will return upload results of indexes 51 to 100.

Hence, you will need to make multiple requests in order to fetch all 500+ videos.
YouTube API - Get All Videos From User limits? has a similar question.

于 2013-04-23T09:36:25.337 回答