Lets say I have a youtube video url www.youtube.com/watch?v=B4CRkpBGQzU&feature=youtube_gdata&par1=1&par2=2
I want to get the video thumbnail ->
Getting the video ID from the URL
$url = "http://www.youtube.com/watch?v=oHg5SJYRHA0&feature=relate";
parse_str( parse_url( $url, PHP_URL_QUERY ) );
echo $vidID;//this is video id
Getting the images
$thumb1 = file_get_contents("http://img.youtube.com/vi/$vidID/0.jpg");
$thumb2 = file_get_contents("http://img.youtube.com/vi/$vidID/1.jpg");
$thumb3 = file_get_contents("http://img.youtube.com/vi/$vidID/2.jpg");
$thumb4 = file_get_contents("http://img.youtube.com/vi/$vidID/3.jpg");