So, basically how can I find out if a link is a video or not? Cause youtube doesn't have the normal .avi, .mp4eg, .badmovie extensions. So like how would I do that?
So, basically how can I find out if a link is a video or not? Cause youtube doesn't have the normal .avi, .mp4eg, .badmovie extensions. So like how would I do that?
(with PHP)
You can try doing a HTTP HEAD request on the link, and then checking the Content-Type.
Oh well you're trying to check if the link is a page with a video.
In that case you need to search the content for a <embed> or <object> with video-y stuff in it. But really there's no way to be completely sure.
If you're targeting YouTube then the watch?v= thing is fine.
When you post a TouYube on here, the forum code looks for the BifRBx92S9I garbage and then wraps it in some embed code. So everything from links, to page source should work.