问题
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