【问题标题】:Single video not picking up on a Youtube API Title Search单个视频未在 Youtube API 标题搜索中获取
【发布时间】:2015-09-14 19:29:32
【问题描述】:

我正在使用 Youtubes PHP API 按标题获取视频,并根据当前日期在页面上列出它们。现在一个视频没有显示,我不知道如何调试这个问题。

https://www.youtube.com/watch?v=F94TV1yZ9NA

我尝试过专门使用 Search: list 搜索频道,在标题和整个标题中包含模糊的关键字,但它不会找到它。

我认为这可能是上传视频的设置,但它似乎与其他视频相同。有人遇到过类似的问题吗?

【问题讨论】:

    标签: php youtube-api youtube-data-api


    【解决方案1】:

    您要查找哪条数据?

    GET https://www.googleapis.com/youtube/v3/videos?part=snippet&id=F94TV1yZ9NA&key={YOUR_API_KEY}
    

    返回 titlepublishedAt 日期

    {
       "kind": "youtube#videoListResponse",
       "etag": "\"jOXstHOM20qemPbHbyzf7ztZ7rI/KQPGXJ3y5hdArWxw_-IKv1yQJV0\"",
       "pageInfo": {
       "totalResults": 1,
       "resultsPerPage": 1
    },
     "items": [
    {
    
    
     "kind": "youtube#video",
     "etag": "\"jOXstHOM20qemPbHbyzf7ztZ7rI/5z-phmMy-V7_yf9pGOHrr3cYshs\"",
     "id": "F94TV1yZ9NA",
     "snippet": {
      "publishedAt": "2015-09-13T22:40:04.000Z",
      "channelId": "UCkhBqbxs8CbO-vYxKROF73g",
      "title": "CDP 2015 September 12 R11",
      "description": "Located at 21 Exhibition Drive in Charlottetown, RED SHORES Racetrack & Casino at Charlottetown Driving Park combines the excitement of live harness & simulcast racing, slots, poker, food and fun in one 'RED HOT' bundle of entertainment - all done Island style!\n\nLocated at 55 Greenwood Drive in Summerside, RED SHORES at Summerside Raceway also offers a RED HOT entertainment package, featuring live & simulcast racing, a gaming floor with 40 slots and live Texas Hold'em Poker tables, plus, casual food & drink in the WEST-END Bar & Grill\n\nRedshores.ca",
      "thumbnails": {
    

    https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.videos.list?part=snippet&id=F94TV1yZ9NA&_h=2&

    编辑:

    如果您搜索 2015 年 9 月 1 日之后发布的前 20 个视频:

    GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCkhBqbxs8CbO-vYxKROF73g&maxResults=20&order=date&publishedAfter=2015-09-01T00%3A00%3A00.000Z&key={YOUR_API_KEY}
    

    你提到的videoID (F94TV1yZ9NA) 被返回

    Try it

    【讨论】:

      猜你喜欢
      • 2019-08-23
      • 1970-01-01
      • 2015-10-23
      • 2013-07-18
      • 2014-11-29
      • 1970-01-01
      • 2017-10-14
      • 2014-05-08
      • 2021-10-14
      相关资源
      最近更新 更多