youtube zend api:结果短于n分钟


youtube zend api: Just results shorter than n minutes

我希望我的查询只产生比 7 分钟短的视频。这可能吗?

目前我使用这个:

$yt = new Zend_Gdata_YouTube();
$yt->setMajorProtocolVersion(2);
$query = $yt->newVideoQuery();
$query->setOrderBy('relevance');
$query->setSafeSearch('none');
$query->setVideoQuery($searchTerms);
// Note that we need to pass the version number to the query URL function
// to ensure backward compatibility with version 1 of the API.
$videoFeed = $yt->getVideoFeed($query->getQueryUrl(2));

文档说,有一个"持续时间"参数:https://developers.google.com/youtube/2.0/reference?hl=de#durationsp

但不幸的是我没有运气

$query->setDuration('short');

但这无论如何都不会这样做,因为它会寻找短于四分钟的视频。

有什么想法吗?

克里斯

我想

你可能想试试$query->setSeconds(240);

我找到了信息:Zend_Gdata_YouTube_Extension_Duration并与 Gdata 交互

祝你好运。