Page 1 of 1

Checking validity of YouTube video with php

Posted: Sat Sep 25, 2010 6:09 am
by defroster
Hello,

I embed some YouTube videos on my site. Sometimes a video is deleted from YouTube and I have no way of knowing. Does anyone know if there is some php script or by using their API you can check if a video has:

- video has been removed
- video is not embeddable any more

any ideas? Thanks
/df

Re: Checking validity of YouTube video with php

Posted: Sat Sep 25, 2010 6:23 am
by defroster
I see if I use this I can get a lot of information from the video but not if it is embeddable or not.
http://gdata.youtube.com/feeds/api/videos/i9gucBfZ1qg

and if a video is invalid and I use the link above I get a page that says
'Video not found'

- How could I use this information to loop through a set of links (from own database) and it would tell me if it is valid or not?
- Any ideas how to check also if it is embeddable?

Thanks