There is a davolno old code that parsit YouTube video by reference
<? require_once('libs/JSON.php'); $json = new Services_JSON(); function youtube($url){ global $uid, $json; if(!ereg("http://", $url))$url = "http://".$url; $pars_url = parse_url($url); parse_str($pars_url["query"]); $html = str_replace('$', '', @file_get_contents("http://gdata.youtube.com/feeds/api/videos/".$v."?alt=json")); $video = $json->decode($html); $video_array = (array) $video->entry; //print_R($video_array["title"]->t); //print_R($video->entry->content); if($video_array["title"]->t){ $video_image = "http://img.youtube.com/vi/".$v."/0.jpg"; $video_simage = "http://img.youtube.com/vi/".$v."/2.jpg"; $out["url"] = $url; $out["title"] = iconv("utf-8", "windows-1251", str_replace(array("\n" ,"\r", '"',"/"),array('\n' ,'\r', '\"', ""), $video_array["title"]->t)); $out["description"] = iconv("utf-8", "windows-1251", str_replace(array("\n" ,"\r", '"',"/"),array('\n' ,'\r', '\"', "\/"),$video_array["content"]->t)); $out["images"] = array($video_image, $video_simage); $out["domain"] = $pars_url["host"]; $out["duration"] = $video_array["mediagroup"]->ytduration->seconds; $out["error"] = "1"; $out["vid"] = $v; $out["uid"] = $uid; $out["hash"] = md5($uid.$out["vid"]."youtube_add".date("ym").$out["duration"].$video_image.$video_simage); }else{ $out["error"] = "2"; } //print_R($out); return $out; } ?> This method has not worked for a long time. Where do I need to rule, what would work? Thank you in advance..
$out? - DaemonHK$outclear information about the video. At the moment, what does the script return and what kind of errors? - DaemonHKeregwithpreg_match,eregis a deprecated function. 2. The function does not know the $ v variable. 3. Get Rid of the Error Suppressor@- DaemonHK