I've had some code in production for 6 months or so that runs every 24 hours and pulls all videos from certain YouTube channels that were published in the last 24 hours (i.e. since it last checked). It's been working well.
HOWEVER
A couple of the YouTube channels this code monitors publish some kind of "placeholder" or "teaser" a day or two ahead of publishing the actual video, which means that my code "sees" the video twice:
- when the placeholder is published
- when the actual video is published
I'm not interested in #1, since there's no video actually available yet, just a teaser that it's "coming soon". I'm only interested in knowing about the video once it's actually been published. Is there a way to filter out these placeholders from my search, so that my code only "sees" the video when it is actually published? A search parameter would be ideal, but if this can only be done by filtering of the result in my own code (e.g. by returned metadata), that would work too.
For reference, here's the URL my code hits:
https://youtube.googleapis.com/youtube/v3/search?part=snippet&channelId=[CHANNEL_ID]&order=date&publishedAfter=[NOW_MINUS_24_HOURS]&key=[MY_API_KEY]
Here's an example of a video where this happened, albeit I don't think there's any way to know that a placeholder had been published a day or two prior to the video going up.
https://stackoverflow.com/questions/66082814/youtube-data-api-v3-list-all-videos-for-a-channel-published-in-the-last-24-hour February 07, 2021 at 06:52AM
没有评论:
发表评论