PlaylistItems.list is slow to serve the latest videos available - youtube-api

I'm scraping the latest uploaded videos from a channel and it's working fine but I noticed that the PlaylistItems.list API is sometimes slow to offer the latest videos.
It can take days for a new video to show up on a uploaded playlist's query result.
For example:
Today, Sep 07 00:59:07 2017 UTC, this playlistItems.list query is not returning a video posted yesterday at Sep 06 01:26:13 UTC.
The strange thing is that the API has data about the video in question, if asked about it individually using the videoId 0QlUOWbdIWw, and the YouTube playlist also recognizes that the new video exists.
Is there a delay between the video data being available and it being included in the channel's uploaded playlist?
Edit: Although the example I posted is using anonymous requests, my app is issuing them with authentication.

Related

How come my video gets locked as private when using the resumable upload api? (youtube)

Around April 2021 I uploaded this video: https://www.youtube.com/watch?v=xmTTrrO0gj8
Recently, I helped someone do this same here: https://www.youtube.com/watch?v=iY7LaiMRc38&ab_channel=Zizyo
However, I tried to upload another video. This time it got locked as PRIVATE.
Then I found this:
https://developers.google.com/youtube/v3/docs/videos/insert
It said:
All videos uploaded via the videos.insert endpoint from unverified API projects created after 28 July 2020 will be restricted to private viewing mode. To lift this restriction, each API project must undergo an audit to verify compliance with the Terms of Service. Please see the API Revision History for more details.
I don't understand. Both my video and the video I helped someone to upload were uploaded after this restriction was enforced. How was I able to upload a video this way, and now I can't?
EDIT: I am asking how I was ABLE to upload the video, I already know there is this restriction. I was able to upload the video after the restriction was enforced, how can I do it again?

All data except for fileName disappears from fileDetails in a couple of days after uploading the video

I'm using YouTube Data API (v3) to access my own video info.
Everything worked fine, I could get fileDetails.fileSize, fileDetails.videoStreams[] etc. as I expected.
However, in a couple of days after I uploaded the video, the same API returns only fileDetails.fileName and no other info anymore.
Now returned json looks like this:
"fileDetails": {
"fileName": "test movie.mp4"
}
Here is my request URL:
https://www.googleapis.com/youtube/v3/videos?part=fileDetails&id=__my_video_id__
The video is owned by my account with which I did OAuth and got an access token.
I tried the URL on OAuth 2.0 Playground (https://developers.google.com/oauthplayground/), but I got the same result though once it returned all data when I tried it on the day I uploaded the video.
I wonder it might be related to the video visibility since I set it to unlisted so that others won't find my test video by searching.
Any info is welcome!
Edited:
The video itself doesn't have any problem. I can play it on YouTube and via YouTube iframe API also.
I'm aware that YouTube has a system which automatically detects copyright infringements, however, this issue seems to happen randomly even when we don't violate any copyright of others. (happens with our original videos too)
We finally decided to cache fileDetail on our backend.

YouTube API: why can't I see latest video for this channel?

The latest video for this channel shows up when viewed via the Youtube website:
https://www.youtube.com/user/stefbot/videos
(video ID a4pPLwAL_Qo)
However that video does not get returned when the channel is queried via the Youtube API. I retrieve the channel video list by making a call to channels, followed by a call to playlistItems e.g.:
https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=stefbot&key=xxxxxxxxxxxxxxxxx
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=UUC3L8QaxqEGUiBC252GHy3w&key=xxxxxxxxxxxxxxxxxx
See playlist response JSON here
It has been more than 24hrs since this video was posted. Can someone explain why the API would not be returning the latest video for this channel?
Based from this support page, it can take a few days for uploaded videos to be reflected in YouTube search results, especially if you recently changed or removed your video. Also, you can use this reference and use Search: list to get the latest videos from user's uploads.
GET https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={CHANNEL_ID}&maxResults=10&order=date&type=video&key={YOUR_API_KEY}

How to get watch later playlist details after September 12th?

Today, on YouTube's revision history page it is stated that
The channel resource's contentDetails.relatedPlaylists.watchHistory
and contentDetails.relatedPlaylists.watchLater properties are only
visible to an authorized user retrieving data about the user's own
channel. After September 12, 2016, the
contentDetails.relatedPlaylists.watchHistory will return a value of HL
and the contentDetails.relatedPlaylists.watchLater property will
return a value of WL for all channels.
Requests to retrieve playlist details (playlists.list) for a channel's
watch history or watch later playlist will return an empty list after
September 12, 2016. Requests to retrieve playlist items
(playlistItems.list) in either of those playlists will also return an
empty list after that time. This is true for the new values, HL and
WL, as well as for any watch history or watch later playlist IDs that
your API Client may have already stored.
I have an (ok-working) extension thats only feature right now is to show the total length of time of a YouTube playlist. Right now you have to refresh the page (any page with a playlist on it) in order for the length to show up. I use playlists.list and playlistItems.list to get length details of each video in the playlist, you can view the source here. (Btw, you should totally comment on my code quality, I like feedback) As you can see from the revision, this extension won't work after September 12th for watch later playlists.
Anyways, the most useful case of my extension is to see how long it would take to get through your watch later playlist. Currently I know that it would take me 4 Days 17 Hours 7 Minutes and 10 Seconds to watch all 365 videos on my watch later playlist. After September 12th, I will not be able to know this information.
How am I supposed to get this information about my watch later playlist then? Which resource do I hit up? Is the next reasonable course of action to get hired by YouTube to work on their backend just to add the total length of time to watch a playlist into playlist.list?
This data will not be available via the YouTube API service after September 15, 2016.
The changelog confirms that the watch history and watch later playlists return empty lists. Unfortunately, no alternative is mentioned.
September 15, 2016.
In addition, requests to retrieve playlist details (playlists.list) or playlist items (playlistItems.list) for a channel's watch history or watch later playlist now return empty lists. This behavior is true for the new values, HL and WL, as well as for any watch history or watch later playlist IDs that your API Client may have already stored.

Youtube V3 Api not returning the latest results

I am making call to the uploads playlist on a channel. On my personal youtube feed it showed that the user uploaded a video "5 minutes ago" so I went to their api explorer and checked the return object of the uploads playlist. The latest video was the one that user uploaded before this one. Basically It didn't have the latest video in the response. I checked thirty minutes later and still not there. Is there anyway I can know on the backend when a user uploads a video right away?

Resources