YouTube GData API-查询具有特定持续时间的视频 [英] YouTube GData API - Query for videos with a specific duration

查看:95
本文介绍了YouTube GData API-查询具有特定持续时间的视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在用于查询的YouTube GData API参数,该参数仅会返回具有最小和/或最大给定持续时间的条目?
我找到了 duration参数,但它只接受值 short, medium和 long。

Is there a YouTube GData API parameter for a query that will only return entries with a minimum and/or a maximum given duration? I've found the "duration" parameter but it only accepts the values "short", "medium", and "long".

推荐答案

好,找到它了!

您需要将此类查询条件集成到 字段 参数,其语法类似于xpath:

You need to integrate such query conditions into the fields parameter, which operates on a syntax similar to xpath:

http://gdata.youtube.com/feeds/api/videos?fields=entry[*videoVariable* operator *value*]

所以我一直在寻找,则 fields 参数值应为:

So for what I was looking for, the fields parameter value would have been:

entry[media:group/yt:duration/@seconds > *min_value* and media:group/yt:duration/@seconds < *max_value*]

https://developers.google.com/youtube/2.0/developers_guide_protocol_partial

这篇关于YouTube GData API-查询具有特定持续时间的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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