So I have this broken Youtube playlist (PHP loop that gets playlist info from Youtube feed). Oddly, it broke when a few duplicate/failed upload videos were deleted, no clue why.
Anyways, I have this playlist feed URL which doesn't seem to work, but was working earlier: http://gdata.youtube.com/feeds/api/playlists/6549D4CA7BB99B16?v=2
What is the number following /playlists/? It doesn't look like a playlist ID (since they appear to start with 'PL') or a user ID http://www.youtube.com/playlist?list=PL6549D4CA7BB99B16.
I have several such feeds in the code, they all used to work. Thoughts?
It is the playlist ID -- YouTube apparently just recently instituted a change that requires appending the 'PL' characters, like this:
http://gdata.youtube.com/feeds/api/playlists/PL6549D4CA7BB99B16?v=2
Related
I am wondering if anyone knows what could be the cause of this.
On a channel's upload playlist, it states there are 143 videos in the playlist:
When I use the "Playlistitems" API (with paging):
https://developers.google.com/youtube/v3/docs/playlistItems/list
I get 138 items.
I have singled out a specific video that is in the Playlist on YouTube as an example. Video ID Q3UDhRDLbPg:
But when I use the "Playlistitems" API explorer, on the playlist and specify the specific video, I get zero results.
The video is public and was uploaded a few days ago. Some videos that were uploaded on the same day does exist in the results too.
Has anyone seen this problem before and might know the cause of it?
This issue is solved.
As #stvar pointed out, there is some kind of a delay in YouTube's backend, some videos might take longer to be included than others.
All videos are accounted for now, 4 days after the upload time.
I am trying to use youtube api to fetch the latest video uploaded in a channel and the query is as below
https://www.googleapis.com/youtube/v3/search?key={KEY}&channelId={CHANNEL-ID}&part=snippet&maxResults=1&order=date&type=video
But it is not returning the latest video uploaded in that channel. Adding or removing order attribute doesn't seem to work as it keeps returning the same video.
You have do to this by fetching playlist items. Get your channel id. It should look like this: UC######################. Now you have to replace the 'C' to 'U'. Like this: UU######################. You can call the youtube api with this id now.
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=UU######################&maxResults=5&key=[YOUR_API_KEY]
Youtube use to have a feature where you could click a more videos button while watching any video, and see a snapshot of the uploads playlist with videos uploaded before and after the one you are currently watching.
I am trying to get a list like that with the v3 data API and it seems there is no way. There use to be a way to dictate an index when using the playlistItems call, but now there isn't.
If you go to a channels upload playlist and click play all, you can see a list of videos surrounding the one you are watching, so it seems this functionality is possible, but I don't know how they are doing it.
Any ideas?
I have searched the web tirelessly and looked through the YouTube API, but I still can't seem to find a way in which to request videos from a specific channel which have been uploaded since a certain date-time.
Something along the lines of this:
GET https://www.googleapis.com/youtube/v3/channels?part=videoContent&channel=UC_x5XG1OV2P6uZZ5FSM9Ttw&uploadedAfter=1421056357914
What you'd want to do is to get the channel's uploads playlist, the do a playlistItems.list with it.
Though currently playlistItems.list doesn't support orderBy or uploadedAfter, it's in the works.
It's a known issue that Youtube API (v2) doesn't support liked videos - http://www.youtube.com/my_liked_videos (not http://www.youtube.com/my_favorites). The trick was to use events API for user's recent activity and filter out those with yt:rating.value = like. However, when I hit this endpoint https://gdata.youtube.com/feeds/api/users/default/events?inline=true (with proper authorization headers), I only get last 24 events and all of them are of 'X has uploded a video' type. Has anyone experienced this and figured out what is wrong?
You can get liked videos without much effort in v3 of the API. I don't think there's a workaround for this in v2.
In v3, make a channels.list(part=contentDetails) call to get the "likes" playlist id, and then do a playlistItems.list() call to get the contents of that playlist, i.e. the videos that have been liked.