YouTube GData API - Query for videos with a specific duration

情到浓时终转凉″ 提交于 2019-12-10 12:12:55

问题


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".


回答1:


Ok, found it!

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*]

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



来源:https://stackoverflow.com/questions/10482203/youtube-gdata-api-query-for-videos-with-a-specific-duration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!