为什么我从进料只得到25的YouTube视频? [英] Why can I get only 25 YouTube video from a feed?

查看:165
本文介绍了为什么我从进料只得到25的YouTube视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对C#/这code网:

I have this code on C#/.NET :

string user = "Username";
string feedUrl = "http://gdata.youtube.com/feeds/api/users/" + user + "/uploads";
Feed<Video> videoFeed = request.Get<Video>(new Uri(feedUrl));

foreach (Video entry in videoFeed.Entries)
{
    // print video
}

但我只能检索25个视频!

but I can retrieve only 25 video!

知道的在饲料视频的最大数量是999:

I know the max number of video in a feed is 999 :

该API返回一个视频馈送响应于请求来搜索视频。一个视频供稿最多包含999项。检索搜索结果,发送API请求发送到以下网址:

The API returns a videos feed in response to a request to search for videos. A videos feed contains a maximum of 999 entries. To retrieve search results, send an API request to the following URL:

http://gdata.youtube.com/feeds/projection/videos?v=2

那么,为什么25?

试图与上传/启动指数= 0&放大器; MAX-结果= 999 ,但没有...

Tried with uploads/?start-index=0&max-results=999 but nothing...

推荐答案

999数字是指视频,可以在播放列表或饲料存在的最大数目:

The 999 figure refers to the maximum number of videos that can exist in a playlist or feed:

该API返回一个视频馈送响应于请求来搜索视频。一个视频供稿最多包含999项。

The API returns a videos feed in response to a request to search for videos. A videos feed contains a maximum of 999 entries.

在默认情况下它返回25结果,虽然你可以覆盖这样的:

By default it returns 25 results, though you can override this:

在MAX-results参数用于指定结果的最大数目   应包括在结果集中。该参数在   与启动索引参数一起使用,以确定哪种结果   回来。例如,要请求第二组的10个结果 - 即   结果11-20 - 设置最大-results参数为10,   启动索引参数〜11的默认值的这个参数是   25,以及最大值为50。但是,用于显示的列表   视频中,我们建议您设置的MAX-results参数为10。

The max-results parameter specifies the maximum number of results that should be included in the result set. This parameter works in conjunction with the start-index parameter to determine which results to return. For example, to request the second set of 10 results – i.e. results 11-20 – set the max-results parameter to 10 and the start-index parameter to 11. The default value of this parameter is 25, and the maximum value is 50. However, for displaying lists of videos, we recommend that you set the max-results parameter to 10.

<一个href="http://$c$c.google.com/intl/it-IT/apis/youtube/2.0/reference.html#max-resultssp">http://$c$c.google.com/intl/it-IT/apis/youtube/2.0/reference.html#max-resultssp

MAX-结果的最大值是50,所以你需要使用发出多个请求启动指数来取结果的每一块。

The maximum value of max-results is 50, so you'll need to issue multiple requests using start-index to fetch each block of results.

这篇关于为什么我从进料只得到25的YouTube视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆