【问题标题】:Using youtube api with node.js client将 youtube api 与 node.js 客户端一起使用
【发布时间】:2014-01-14 05:20:53
【问题描述】:

我正在尝试调用 Youtube 视频搜索端点,但我收到错误消息“未选择过滤器。”。这里缺少什么必需参数?

googleapis
    .discover('youtube', 'v3')
    .execute(function (err, client) {
        var params = {
            part: 'snippet',
            maxResults: 50,
            order: 'viewCount',
            q: 'liverpool'
        };

        var request = client.youtube.videos.list(params).withApiKey('*****');

        request.execute(function (err, response) {
            console.log(err);
            res.send('done');
        });

    });

【问题讨论】:

    标签: javascript node.js youtube-api google-api google-api-nodejs-client


    【解决方案1】:

    您应该为视频列表提供至少一个过滤器名称,指定为here

    例子-

    var params = {
                part: 'snippet',
                maxResults: 50,
                order: 'viewCount',
                q: 'liverpool',
                chart: 'mostPopular'
    };
    

    【讨论】:

      猜你喜欢
      • 2017-12-15
      • 2015-06-16
      • 2013-03-02
      • 1970-01-01
      • 1970-01-01
      • 2014-04-23
      • 2016-03-08
      • 2012-10-12
      • 2020-06-09
      相关资源
      最近更新 更多