YouTube 的 PubSubHubbub:识别视频是新添加的还是仅更新的 [英] YouTube's PubSubHubbub: identify whether video is newly added or only updated

查看:24
本文介绍了YouTube 的 PubSubHubbub:识别视频是新添加的还是仅更新的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于链接的指南告诉您可以确定视频是新的或通过 元素的值更新.我的问题很简单:如何? 元素的值有何变化,以便我可以区分新视频和更新视频?

提前致谢!

解决方案

很遗憾,您的阅读(引用):

<块引用>

[...] 告诉可以通过 元素的值来识别视频是新视频还是更新视频.

不正确.

您提到的规范说:

<块引用>

请注意,您可以使用 元素的值来标识新添加或更新的视频.

这意味着 的值是视频的 ID,该视频是新创建的视频或更新的视频.

<yt:videoId> 没有任何变化,因为任何视频 ID 都是在 YouTube 后端(以及网站和视频)的整个生命周期内唯一的标识符.

但请注意在 YouTube 的服务器通知中存在的 XML 元素 :这两个元素应该可以区分新视频和一个更新的.遗憾的是,提到的官方文档根本没有指定这两个 XML 元素的预期内容.(这个问题很值得通过其自己的问题跟踪网站向 Google 本身报告.)>

此外,其他开发人员处理此问题的经验是不确定和矛盾的(例如参见 这篇关于 Codeproject 的文章Github 上的这个帖子):这意味着 YouTube 的后端服务器实现随着时间的推移发生了变化.

我建议您自己试验 ,以便提出您自己的有根据的猜测,以便在您部署的应用程序中使用.

The guide on this link tells it is possible to identify whether a video is new or updated via the <yt:videoId> element's value. My question is pretty straightforward: how? What changes with the <yt:videoId> element's value so I can distinguish between a new and an updated video?

Thanks in advance!

解决方案

Unfortunately, your reading (quote):

[...] tells it is possible to identify whether a video is new or updated via the <yt:videoId> element's value.

is incorrect.

The specification you referred to says:

Note that you can use the <yt:videoId> element's value to identify the newly added or updated video.

That means that the value of <yt:videoId> is the ID of the video that is either a newly created video or an updated one.

Nothing changes with <yt:videoId>, since any video ID is an identifier that's unique during the entire lifetime of YouTube back-end (and website, and video for that matter).

But notice the presence of the XML elements <published> and <updated> within the YouTube's server notification: these two should make the difference between a new video and an updated one. Regrettably is that the official document mentioned does not specify at all what is to be expected from these two XML elements. (This very issue could well deserve to be reported to Google itself through its own issue tracker site.)

Furthermore, the experience of other developers dealing with this issue is inconclusive and contradictory (see for example this article on Codeproject and this thread on Github): this means that over time the YouTube's back-end server implementation changed.

I recommend to experiment yourself with <published> and <updated>, such that to come up with your own educated guess to be used within your deployed application.

这篇关于YouTube 的 PubSubHubbub:识别视频是新添加的还是仅更新的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆