1
a7898585 2013-10-18 23:27:02 +08:00
求分享源码
|
2
wontao 2013-10-19 00:21:45 +08:00 1
function get_youku_thumb($url) {
$content = file_get_contents($url); preg_match( '/id="s_msn2".*?screenshot=(.*?)".?target=/', $content, $matchs ); return $matchs[1]; } echo get_youku_thumb(''); |
3
jingwentian 2013-10-20 01:09:12 +08:00
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; } |