and: " . $post_data); die(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $login_url); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_COOKIEJAR, "./cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "./cookie.txt"); $html = curl_exec($ch); curl_setopt($ch, CURLOPT_URL, "http://www.youtube.com/verify_age?next_url=".urlencode($tmp)); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, "action_confirm=Confirm&next_url=".urlencode($tmp)); curl_setopt($ch, CURLOPT_COOKIEJAR, "./cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "./cookie.txt"); $html = curl_exec($ch); curl_close($ch); */ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_COOKIEJAR, "./cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "./cookie.txt"); $html = curl_exec($ch); if(preg_match('/(video_id=.+?)&.+?(&t=.+?)&f/', $html, $matches)) { $flv = 'http://www.youtube.com/get_video?'.$matches[1].$matches[2]; // get the title if(preg_match('/(.+?)<\/title>/', $html, $matches)) $name = $matches[1].'.flv'; else $name = ''; $results[] = array('source' => $url, 'url' => $flv, 'name' => $name); } ?>