$url = 'http://www.youtube.com/get_video_info';
$params = [
'video_id' => '{%YOUTUBE_VIDEO_ID%}',
];
$response = file_get_contents($url . '?' . http_build_query($params));
// www.youtube.com/get_video_info?video_id={%YOUTUBE_VIDEO_ID%}
parse_str($response, $response);
switch ($response['status']) {
case 'ok':
echo 'OK';
break;
case 'fail':
echo 'FAIL';
break;
default:
echo 'UNKNOWN';
}