How to pragmatically test that youtube video links is ok - youtube

Here is a link to video which does not work
https://www.youtube.com/watch?v=abEOkul6HEx
How I can programatically detect this ?
The scenario would be to monitor a list of youtube videos and detect if a single video was deleted or is no longer available
Any ideas ?

You can use following youtube v3 API GET request
https://www.googleapis.com/youtube/v3/videos?part=id&id={VIDEO_ID}&key={YOUR_API_KEY}
In the results check for pageInfo.totalResults attribute
Update
If you want to pass multiple video ids in one API, it also can. id={VIDEO_ID1},{VIDEO_ID2}. In this case you can't depend on pageInfo.totalResults you have to go through items[].id decide.

Related

Get list of videos uploaded before and after certain video

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?

How to screenscrape my youtube video feed?

How to get the feed of my account? (Or how can I sign in my account when using Nokogiri?)
What would be a good solution to get the video from various video channels?(So I can avoid signing in my account in problem1)
Specifically, how to deal with pagination?
The videos screenscraped may not be all needed. How can I make a pre-save page to cancel out the videos that I don't want? i.e. create a editing interface for screenscraping
YouTube has a developers API from which all this should be available. Have you checked it out? See:
https://developers.google.com/youtube/

how to ensure that a youtube API response only contains videos that are suitable for playback on a mobile device

I am trying to add some youtube videos from my Admin page to database. So that mobile application can make use of them to play.
I want to filter the result from YouTube API link so that i can make sure that whatever videos i add to the database will be able to play on mobile devices like IOS and Android.
I tried
&format=5 and &format=1
but no use.
I also went through Youtube API v2.0 Docs but unable to find the correct way to assign fields parameter to my query string
can anyone guide me to fix this?
What you need is videoEmbeddable and videoSyndicated.
Here's my answer to original question: retrive only mobile-supported video from YouTube API

is there an alternate way to get video tags/keywords in youtube api

based on http://youtubecreator.blogspot.com/2012/08/tags-removed-from-video-watch-pages.html, youtube has made media:keywords element empty in youtube api as well.
However, it is important for my application to scan through the tags/keywords. Is there an alternate solution for me to get the tags/keywords for a video?
This blog post gives information relevant to developers: http://apiblog.youtube.com/2012/08/video-tags-just-for-uploaders.html
You can get the tags if you're authenticated as the owner of the video. Otherwise, no, it's not currently possible.

include existing youtube video in my own youtube account

Is it possible to add to my youtube account a video I liked in youtube without having to upload it?
This is for an application i´m developing... I´m looking for something similar to share on twitter feature.
But any help is welcome!
Thanks
You can add it as a favourite, as Yuliy has said, or you can create yourself a channel, add a playlist to that channel, then add the video in a similar way to the playlist.
Doing it this way means you can 'see' it from the API(getplaylists, getplaylist)... But, if the original author decides to take the video down, then of course it will disappear from your channel page as well (or more likely say 'this video has been removed by the user').
You cant keep a 'copy' of the video like this.

Resources