2016-03-09 63 views
0

我正在尋找返回YouTube中的信息流的日程安排日期。定流的返回即將推出的YouTube API V3視頻日程安排日期?

例子: enter image description here

YT鏈接:https://www.youtube.com/channel/UCP7jMXSY2xbc3KCAE0MHQ-A

這是我的代碼來拉這個數據出來使用YouTube V3 API:

 $videos = $this->yt->searchAdvanced(array(
      'q' => '', 
      'part' => 'snippet', 
      'channelId' => $this->channel_id, 
      'eventType' => $event_type, // Upcoming 
      'type' => 'video', 
      'order' => 'date', 
      'maxResults' => $max, 
      'key' => YOUTUBE_API_KEY 
     )); 

這裏是對象由此返回: enter image description here

如果我使用我的功能獲取視頻信息,這是我可以獲得的所有信息。這是使用部分:

id, snippet, contentDetails, player, statistics, status 

:預定日期在哪裏? :

stdClass Object 
(
    [kind] => youtube#video 
    [etag] => "q5k97EMVGxODeKcDgp8gnMu79wM/KAZsrzeX5ImiUQpLbwhPR7lo9mA" 
    [id] => qUAmTYHEyM8 
    [snippet] => stdClass Object 
     (
      [publishedAt] => 2016-03-03T06:48:50.000Z 
      [channelId] => UCP7jMXSY2xbc3KCAE0MHQ-A 
      [title] => Match 3 - Google DeepMind Challenge Match: Lee Sedol vs AlphaGo 
      [description] => Watch DeepMind's program AlphaGo take on the legendary Lee Sedol (9-dan pro), the top Go player of the past decade, in a $1M 5-game challenge match in Seoul. This is the livestream for Match 3 to be played on: 12th March 13:00 KST (local), 04:00 GMT; note for US viewers this is the day before on: 11th March 20:00 PT, 23:00 ET. 

In October 2015, AlphaGo became the first computer program ever to beat a professional Go player by winning 5-0 against the reigning 3-times European Champion Fan Hui (2-dan pro). That work was featured in a front cover article in the science journal Nature in January 2016. 

Match commentary by Michael Redmond (9-dan pro) and Chris Garlock. 
      [thumbnails] => stdClass Object 
       (
        [default] => stdClass Object 
         (
          [url] => https://i.ytimg.com/vi/qUAmTYHEyM8/default_live.jpg 
          [width] => 120 
          [height] => 90 
         ) 

        [medium] => stdClass Object 
         (
          [url] => https://i.ytimg.com/vi/qUAmTYHEyM8/mqdefault_live.jpg 
          [width] => 320 
          [height] => 180 
         ) 

        [high] => stdClass Object 
         (
          [url] => https://i.ytimg.com/vi/qUAmTYHEyM8/hqdefault_live.jpg 
          [width] => 480 
          [height] => 360 
         ) 

        [standard] => stdClass Object 
         (
          [url] => https://i.ytimg.com/vi/qUAmTYHEyM8/sddefault_live.jpg 
          [width] => 640 
          [height] => 480 
         ) 

        [maxres] => stdClass Object 
         (
          [url] => https://i.ytimg.com/vi/qUAmTYHEyM8/maxresdefault_live.jpg 
          [width] => 1280 
          [height] => 720 
         ) 

       ) 

      [channelTitle] => DeepMind 
      [categoryId] => 28 
      [liveBroadcastContent] => upcoming 
      [localized] => stdClass Object 
       (
        [title] => Match 3 - Google DeepMind Challenge Match: Lee Sedol vs AlphaGo 
        [description] => Watch DeepMind's program AlphaGo take on the legendary Lee Sedol (9-dan pro), the top Go player of the past decade, in a $1M 5-game challenge match in Seoul. This is the livestream for Match 3 to be played on: 12th March 13:00 KST (local), 04:00 GMT; note for US viewers this is the day before on: 11th March 20:00 PT, 23:00 ET. 

In October 2015, AlphaGo became the first computer program ever to beat a professional Go player by winning 5-0 against the reigning 3-times European Champion Fan Hui (2-dan pro). That work was featured in a front cover article in the science journal Nature in January 2016. 

Match commentary by Michael Redmond (9-dan pro) and Chris Garlock. 
       ) 

     ) 

    [contentDetails] => stdClass Object 
     (
      [duration] => PT0S 
      [dimension] => 2d 
      [definition] => sd 
      [caption] => false 
      [licensedContent] => 1 
     ) 

    [status] => stdClass Object 
     (
      [uploadStatus] => uploaded 
      [privacyStatus] => public 
      [license] => youtube 
      [embeddable] => 1 
      [publicStatsViewable] => 1 
     ) 

    [statistics] => stdClass Object 
     (
      [viewCount] => 41 
      [likeCount] => 1 
      [dislikeCount] => 0 
      [favoriteCount] => 0 
      [commentCount] => 0 
     ) 

    [player] => stdClass Object 
     (
      [embedHtml] => 
     ) 

) 

注意,我強調的出版日期是計劃日期。

正如你所看到的那樣,沒有安排日期。我是否需要將更多數據傳遞給「部分」?他們的API表明沒有更多的數據可以被撤回。

https://developers.google.com/youtube/v3/docs/search/list#request

感謝

回答

2

好,我的工作了。

只需將liveStreamingDetails添加到part參數中即可。

我試圖通過search.list來實現。取而代之,使用videos.listliveStreamingDetails來獲取計劃日期,因爲search.list不支持liveStreamingDetails

乾杯

相關問題