':','\u002e'=>'.'); $pic=$items[1]; if(!empty($pic)) { preg_match("/id:\s*\"([^,]+)\"/i",$context,$items); $id=$items[1]; $source_url="http://player.ku6.com/refer/$id/v.swf"; } } elseif(strpos($url,'v.youku.com')!==false) { // preg_match("/videoId2=(.*)';/i",$files,$items); // $videoId2=trim(str_replace('\'','',$items[1])); // if(!empty($videoId2)) // $source_url="http://player.youku.com/player.php/sid/$videoId2/v.swf"; $source_url=preg_replace("/id_(.*)\.html(.*)/i","http://player.youku.com/embed/\${1}",baseName($url)); } return $source_url; } function file_get_url($url=''){ if(!empty($url)){ $ctx = stream_context_create(array( 'method'=>'GET', 'http' => array( 'timeout' => 1 //设置一个超时时间,单位为秒 ) ) ); $files=file_get_contents($url,false,$ctx); return $files; }else{ return false; } } function tudou_get($url){ preg_match('#https?://(?:www\.)?tudou\.com/(?:programs/view|listplay/(?[a-z0-9_=\-]+))/(?[a-z0-9_=\-]+)#i', $url, $matches ); print_r($matches);die(); return handler_tudou( $matches); } function handler_tudou( $matches ) { $embed = sprintf( 'http://www.tudou.com/v/%1$s/&resourceId=0_05_05_99&bid=05/v.swf', $matches['video_id'] ); return $embed; } ?>