如何整合Youtube PubSubHubBub通知

时间:2019-04-10 06:47:15

标签: push-notification youtube-api pubsubhubbub

我使用https://pubsubhubbub.appspot.com/subscribe订阅了YouTube频道。

我的答复是

 {"hub_topic":"https:\/\/www.youtube.com\/xml\/feeds\/videos.xml?channel_id=UCc7VM8Y8dDTG9fu-X1UrliQ",
"hub_challenge":"13220839416583683898",
"hub_mode":"subscribe",
"hub_lease_seconds":"432000"}

我返回$_REQUEST["hub_challenge"]值。一切都很好。

但是我没有得到任何响应xml。 如何获取视频信息作为xml响应?

我的php代码

<?php

return $_REQUEST["hub_challenge"];

?>

有关

的用户诊断信息

https://pubsubhubbub.appspot.com/topic-details?hub.url=https%3A%2F%2Fwww.youtube.com%2Fxml%2Ffeeds%2Fvideos.xml%3Fchannel_id%3DUCc7VM8Y8dDTG9fu-X1UrliQ

Topic Details

https://www.youtube.com/xml/feeds videos.xml?channel_id=UCc7VM8Y8dDTG9fu-X1UrliQ

Last successful fetch
Tue, 09 Apr 2019 14:30:22 +0000
Last ping
Tue, 09 Apr 2019 14:30:21 +0000
Last fetch error
n/a
Aggregate statistics
0 fetch request(s) per second to www.youtube.com, 0% errors
Last item retrieved
Content received
Tue, 09 Apr 2019 14:30:22 +0000

<entry>
  <id>yt:video:VBovsnkhqWo</id>
 <yt:videoId>VBovsnkhqWo</yt:videoId>
 <yt:channelId>UCc7VM8Y8dDTG9fu-X1UrliQ</yt:channelId>
 <title>AYI CAN BASIYO! 10. SEVİYE NİTA ve YILDIZ GÜCÜ !!! - Brawl   Stars</title>
<link rel="alternate" href="https://www.youtube.com/watch?v=VBovsnkhqWo"/>
<author>
 <name>Oyunların Ustası</name>
 <uri>https://www.youtube.com/channel/UCc7VM8Y8dDTG9fu-X1UrliQ</uri>
 </author>
<published>2019-04-09T12:00:08+00:00</published>
<updated>2019-04-09T12:00:56.087554137+00:00</updated>
</entry>

0 个答案:

没有答案