diff --git a/upload/source/function/media/media_qq.php b/upload/source/function/media/media_qq.php index a580dc4..34aeeb6 100644 --- a/upload/source/function/media/media_qq.php +++ b/upload/source/function/media/media_qq.php @@ -4,11 +4,11 @@ if(!defined('IN_DISCUZ')) { exit('Access Denied'); } -$checkurl = array('v.qq.com/x/page/'); +$checkurl = array('v.qq.com/x/page/','v.qq.com/x/cover/'); function media_qq($url, $width, $height) { - if(preg_match("/https?:\/\/v.qq.com\/x\/page\/([^\/]+)(.html|)/i", $url, $matches)) { - $vid = explode(".html", $matches[1]); + if(preg_match("/https?:\/\/v.qq.com\/x\/(page|cover)\/([^\/]+)(.html|)/i", $url, $matches)) { + $vid = explode(".html", $matches[2]); $flv = 'https://imgcache.qq.com/tencentvideo_v1/playerv3/TPout.swf?vid='.$vid[0]; $iframe = 'https://v.qq.com/iframe/player.html?vid='.$vid[0]; } diff --git a/upload/source/function/media/media_youku.php b/upload/source/function/media/media_youku.php index f3cb4cb..8a98cbb 100644 --- a/upload/source/function/media/media_youku.php +++ b/upload/source/function/media/media_youku.php @@ -9,17 +9,18 @@ $checkurl = array('v.youku.com/v_show/'); function media_youku($url, $width, $height) { $ctx = stream_context_create(array('http' => array('timeout' => 10))); if(preg_match("/^https?:\/\/v.youku.com\/v_show\/id_([^\/]+)(.html|)/i", $url, $matches)) { - $flv = 'https://player.youku.com/player.php/sid/'.$matches[1].'/v.swf'; - $iframe = 'https://player.youku.com/embed/'.$matches[1]; - if(!$width && !$height) { - $api = 'http://v.youku.com/player/getPlayList/VideoIDS/'.$matches[1]; - $str = stripslashes(file_get_contents($api, false, $ctx)); - if(!empty($str) && preg_match("/\"logo\":\"(.+?)\"/i", $str, $image)) { - $url = substr($image[1], 0, strrpos($image[1], '/')+1); - $filename = substr($image[1], strrpos($image[1], '/')+2); - $imgurl = $url.'0'.$filename; - } - } + $params = explode('.', $matches[1]); + $flv = 'https://player.youku.com/player.php/sid/'.$params[0].'/v.swf'; + $iframe = 'https://player.youku.com/embed/'.$params[0]; + if(!$width && !$height) { + $api = 'http://v.youku.com/player/getPlayList/VideoIDS/'.$params[0]; + $str = stripslashes(file_get_contents($api, false, $ctx)); + if(!empty($str) && preg_match("/\"logo\":\"(.+?)\"/i", $str, $image)) { + $url = substr($image[1], 0, strrpos($image[1], '/')+1); + $filename = substr($image[1], strrpos($image[1], '/')+2); + $imgurl = $url.'0'.$filename; + } + } } return array($flv, $iframe, $url, $imgurl); } \ No newline at end of file