【问题标题】:YouTube search API not filtering embeddable/syndicatable videosYouTube 搜索 API 不过滤可嵌入/可联合的视频
【发布时间】:2020-05-18 05:30:41
【问题描述】:

我正在将 YouTube 视频嵌入到我正在编写的应用中,但其中一些结果是不允许在我的网站上播放的视频。我尝试在参数中将 videoSyndicated 和 videoEmbeddable 都设置为 true,但它似乎无法解决我的问题。

const axios = require('axios');

    const ROOT_URL = 'https://www.googleapis.com/youtube/v3/search';

    const search = (options, callback) => {
      if(!options.key) {
        throw new Error('Youtube Search expected key, received undefined');
      }

      const params = {
        type: 'video',
        videoEmbeddable: true,
        videoSyndicated: true,
        part: 'snippet',
        key: options.key,
        q: options.term,
      };

      axios.get(ROOT_URL, { params })
        .then((response) => {
          if(callback) { callback(response.data.items); }
        })
        .catch((error) => {
          console.error(error);
        });
    };

    export default search;`

【问题讨论】:

标签: google-api youtube-api


【解决方案1】:

这看起来像是第 3 方提出的版权主张,发生在 YouTube API 之外。您可以通过抓取视频页面并搜索版权文本来单独检查。

【讨论】:

  • 这看起来像是评论,而不是问题的答案。
  • 然而这是真的
猜你喜欢
  • 2013-10-11
  • 2018-10-03
  • 2023-03-17
  • 2020-11-28
  • 2019-04-01
  • 2019-08-28
  • 2016-04-20
  • 2013-12-14
  • 2012-02-01
相关资源
最近更新 更多