To update this mod for the new API, try the following:
find
if (preg_match('/youtube\.com\/watch\?v=(.*)/', $YT_URI, $matches)){
$vid = $matches[1];
$xurl = "http://www.youtube.com/api2_rest?method=youtube.videos.get_details&dev_id=xxxxxxxxxxx&video_id=$vid";
$xdata = file_get_contents($xurl);
file_put_contents($CONFIG['fullpath'] . "edit/yt_$vid.xml", $xdata);
// todo: parse the xml properly
if (preg_match('/<thumbnail_url>(.*)<\/thumbnail_url>/', $xdata, $xmatches)){
$thumbnail = $xmatches[1];
$rh = fopen($thumbnail, 'rb');
$wh = fopen($CONFIG['fullpath'] . "edit/yt_$vid.jpg", 'wb');
while (!feof($rh)) fwrite($wh, fread($rh, 1024));
fclose($rh);
fclose($wh);
$escrow_array[] = array('actual_name'=>"youtube_$vid.jpg", 'temporary_name'=> "yt_$vid.jpg");
} else {
$YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> $xdata);
}
change to
if (preg_match('/youtube\.com\/watch\?v=(.*)/', $YT_URI, $matches)){
$vid = $matches[1];
$xurl = "http://gdata.youtube.com/feeds/api/videos/$vid";
$xdata = file_get_contents($xurl);
file_put_contents($CONFIG['fullpath'] . "edit/yt_$vid.xml", $xdata);
// todo: parse the xml properly
//if (preg_match('/<thumbnail_url>(.*)<\/thumbnail_url>/', $xdata, $xmatches)){
$thumbnail = "http://img.youtube.com/vi/$vid/0.jpg";
$rh = fopen($thumbnail, 'rb');
$wh = fopen($CONFIG['fullpath'] . "edit/yt_$vid.jpg", 'wb');
while (!feof($rh)) fwrite($wh, fread($rh, 1024));
fclose($rh);
fclose($wh);
$escrow_array[] = array('actual_name'=>"youtube_$vid.jpg", 'temporary_name'=> "yt_$vid.jpg");
//} else {
// $YT_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $YT_URI, 'error_code'=> $xdata);
//}
Then find
// todo: parse the xml properly
preg_match('/<description>(.*)<\/description>/', $xdata, $xmatches);
$description = substr($xmatches[1], 0, $CONFIG['max_img_desc_length']);
// todo: parse the xml properly
preg_match('/<tags>(.*)<\/tags>/', $xdata, $xmatches);
$keywords = $xmatches[1];
// todo: parse the xml properly
preg_match('/<title>(.*)<\/title>/', $xdata, $xmatches);
$title = substr($xmatches[1], 0, 255);
Change to
// todo: parse the xml properly
preg_match("/<media:description type='plain'>(.*)<\/media:description>/s", $xdata, $xmatches);
$description = substr($xmatches[1], 0, $CONFIG['max_img_desc_length']);
// todo: parse the xml properly
preg_match('/<media:keywords>(.*)<\/media:keywords>/s', $xdata, $xmatches);
$keywords = $xmatches[1];
// todo: parse the xml properly
preg_match("/<media:title type='plain'>(.*)<\/media:title>/s", $xdata, $xmatches);
$title = substr($xmatches[1], 0, 255);
You don't need to sign up for any key with this new API.