function youku( $vid ) {
if ( !$vid ) {
return false;
}
if ( !preg_match( '/^[0-9a-z_-]+$/i', $vid ) ) {
if ( !preg_match( '/^http\:\/\/v\.youku\.com\/v_show\/id_([0-9a-z_-]+)/i', $vid, $match ) && !preg_match( '/^http\:\/\/player\.youku\.com\/player\.php[0-9a-z\/_-]*\/sid\/([0-9a-z_-]+)/i', $vid, $match ) ) {
return false;
}
$vid = $match[1];
}
$url = '
http://v.youku.com/player/getPlayList/VideoIDS/' . $vid;
if ( !$json = $this->url( $url ) ) {
return false;
}
if ( !$json = @
json_decode( $json, true ) ) {
return false;
}
if ( empty( $json['data'][0] ) ) {
return false;
}
$json = $json['data'][0];
$r['vid'] = $json['vidEncoded'];
$r['url'] = '
http://v.youku.com/v_show/id_'. $json['vidEncoded'] .'.html?f=
http://www.lianyue.org/'; $r['swf'] = '
http://player.youku.com/player.php/sid/'. $json['vidEncoded'] .'/lianyue.swf';
$r['title'] = $json['title'];
$r['img']['large'] = $json['logo'];
$r['img']['small'] = str_replace( '.com/11', '.com/01', $json['logo'] );
$r['time'] = $json['seconds'];
$r['tag'] = $json['tags'];
return $r;
}