Closed XrXr closed 10 years ago
Testing 906892940902732a0bbfecd479aef613a6a8683d. Hopefully it addresses the issue.
While 906892940902732a0bbfecd479aef613a6a8683d makes the video check more stable, it still missed an upload during 3 days of testing. (detected one that would've been missed by the old method) The video it missed is simply not present in the search response, even after 2+ hours. A new checking method is needed. After some looking, a map filter based solution that relies on PlaylistItems seems more stable. (It successfully returns the video that cannot be found searching) Implementation of the method will be done soon.
8d0a6e197a43e36e226d9492c90df5f1b85199d7 implements the new checking mechanism. New videos seem to appear in the playlist slower than they do in the search result, however they should always appear eventually. (The video the old checking mechanism missed still isn't in the search result, its been a day) The delay seem to be fairly long(30min? or longer), but this is good for now. For even more robust checking, (this method will miss old videos that appear later than new videos)a cache based approach can be used. However that doesn't seem to be necessary.
An alternate checking method relying on activities
that is similar to the old checking method might be the best. The update doesn't have any delay, and it doesn't seem to miss entries.
Checking via the activities
does seem to work better than checking playlistItems. However, it missed one upload today. I was lucky enough to notice it right away and saw the problem unravel in real time. The new upload appeared after another activity which happened later than the upload. The caching approach will have to be implemented. Since the other activity wasn't an upload, the video was detected as a new upload one cycle later. A situation where two uploads get updated on different time haven't been seen yet, so I will hold off on implementing the new strategy
activities_checking seems to work the best. It has not missed a single video in a week and a half. Which means it is probably the way to go. This should no longer be a problem.
New videos are sometimes omitted in the response of YouTube api.
Example (excerpt from log)
The third channel is UC3tNpTOHsTnkmbwztCs30sA. submitting a query to
youtube/v3/search
With parametersWill return a result that has one video in it. However, according to the log, at the time of checking, nothing was return. I think the source of the problem is when a video is uploaded, it may take some time before the api will return the proper result. A different way of checking for new uploads is desirable for better stability.