【问题标题】:Youtube Api search returns unexpected resultsYoutube Api 搜索返回意外结果
【发布时间】:2018-01-23 00:21:12
【问题描述】:

有了这个请求,我得到了很多结果,只有第一个是我想要的(它在视频标题中有搜索词):

Request: https://www.googleapis.com/youtube/v3/search?key={your_key}&channelId=UCsKrylY2g4-XOkVAQWkpv0g&part=snippet&q=yamatai

结果:https://pastebin.com/HR12bt61

但奇怪的是,如果我添加 order 参数,那么我只会得到一个结果:

Request: https://www.googleapis.com/youtube/v3/search?key={your_key}&channelId=UCsKrylY2g4-XOkVAQWkpv0g&part=snippet&q=yamatai&order=date

结果:https://pastebin.com/2eYbXXSE

如何解释? 另外,请注意,在这两种情况下,两个结果集中的 totalResults=23。但是,在第二种情况下,请求第二个页面会导致一个空集。 我还发现 order=relevance(这是 order 的默认值)返回第一组的所有结果。

【问题讨论】:

    标签: google-api youtube-api youtube-data-api


    【解决方案1】:

    如果记忆服务它只搜索标题,那么在 Youtube api 中搜索是非常奇怪的。其他的来自哪里我不能告诉你第二个我认为它是一个错误或者只是很奇怪

    Testing Link

    GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCsKrylY2g4-XOkVAQWkpv0g&maxResults=25&order=date&q=yamatai&key={YOUR_API_KEY}

    {
     "kind": "youtube#searchListResponse",
     "etag": "\"g7k5f8kvn67Bsl8L-Bum53neIr4/l7VBYhzL4sHmVrkUKgQ9UAR-Lgk\"",
     "regionCode": "DK",
     "pageInfo": {
      "totalResults": 23,
      "resultsPerPage": 25
     },
     "items": [
      {
       "kind": "youtube#searchResult",
       "etag": "\"g7k5f8kvn67Bsl8L-Bum53neIr4/dB7MPu9wutwBJcpbzgegjKHDyko\"",
       "id": {
        "kind": "youtube#video",
        "videoId": "3L_lIjAUnjg"
       },
       "snippet": {
        "publishedAt": "2017-10-03T21:26:28.000Z",
        "channelId": "UCsKrylY2g4-XOkVAQWkpv0g",
        "title": "Board Game 101 (EP85) Yamatai - Règles et Critique",
        "description": "Ce jeu est une gracieuseté d'Univers Ludo.*** Boutique en ligne: https://www.universludo.ca Page Facebook: https://www.facebook.com/universludo 0:36 - Intro 2:12 - Règlements 18:22 -...",
        "thumbnails": {
         "default": {
          "url": "https://i.ytimg.com/vi/3L_lIjAUnjg/default.jpg",
          "width": 120,
          "height": 90
         },
         "medium": {
          "url": "https://i.ytimg.com/vi/3L_lIjAUnjg/mqdefault.jpg",
          "width": 320,
          "height": 180
         },
         "high": {
          "url": "https://i.ytimg.com/vi/3L_lIjAUnjg/hqdefault.jpg",
          "width": 480,
          "height": 360
         }
        },
        "channelTitle": "Professeur Board Game",
        "liveBroadcastContent": "none"
       }
      }
     ]
    }
    

    它说"totalResults": 23, 但只返回一行。我会在问题跟踪器here 上将其作为错误发布@

    【讨论】:

    • 是的,对我来说听起来也像一个错误...问题跟踪器链接:它是被黑了还是什么?我在那里只看到垃圾邮件...
    • 没有它的 Youtube API,他们几乎没有看过它,但我会 ping 某人。
    • @DaImTo 你有没有对此进行过跟进?目前正在处理同样的问题。除了在我的情况下,我得到 totalResults: 1 和空项目列表。
    • 我从未收到回音。五年来我一直在尝试与该团队取得联系,但到目前为止没有运气
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-11-17
    • 1970-01-01
    • 2019-08-20
    • 2014-07-09
    • 2014-05-29
    • 2021-10-31
    • 1970-01-01
    相关资源
    最近更新 更多