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.