【问题标题】:youtube zend api: Just results shorter than n minutesyoutube zend api:结果不到 n 分钟
【发布时间】:2012-08-10 20:52:34
【问题描述】:

我希望我的查询只生成短于例如 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');

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

有什么想法吗?

克里斯

【问题讨论】:

    标签: php zend-framework search youtube-api


    【解决方案1】:

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

    我找到了信息:Zend_Gdata_YouTube_Extension_Duration 和 Interacting with Gdata

    祝你好运。

    【讨论】:

    • 对不起。不工作。我帮助自己使用了 javascript api,如果视频持续时间超过 x 秒,则直接跳过视频。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-25
    • 2018-11-03
    • 2014-05-06
    • 1970-01-01
    • 1970-01-01
    • 2018-02-11
    相关资源
    最近更新 更多