2012-08-10 53 views
0

我希望我的查询结果只在视频中比例如7分钟短。那可能吗?youtube zend api:结果短于n分钟

目前我使用这个:

$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'); 

但是,这是无论如何,它不会做它,而它会寻找短于四分钟的视频。

任何想法?

克里斯

回答

0

我认为你可能会想尝试$query->setSeconds(240);

我发现了信息:Zend_Gdata_YouTube_Extension_DurationInteracting with Gdata

好运。

+0

对不起。不起作用。我帮助自己使用javascript api,并且如果持续时间超过x秒,就简单地跳过视频。 – 2012-08-19 20:23:04