parent
14ec6ab0ed
commit
5785043780
|
@ -4,11 +4,11 @@ if(!defined('IN_DISCUZ')) {
|
||||||
exit('Access Denied');
|
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) {
|
function media_qq($url, $width, $height) {
|
||||||
if(preg_match("/https?:\/\/v.qq.com\/x\/page\/([^\/]+)(.html|)/i", $url, $matches)) {
|
if(preg_match("/https?:\/\/v.qq.com\/x\/(page|cover)\/([^\/]+)(.html|)/i", $url, $matches)) {
|
||||||
$vid = explode(".html", $matches[1]);
|
$vid = explode(".html", $matches[2]);
|
||||||
$flv = 'https://imgcache.qq.com/tencentvideo_v1/playerv3/TPout.swf?vid='.$vid[0];
|
$flv = 'https://imgcache.qq.com/tencentvideo_v1/playerv3/TPout.swf?vid='.$vid[0];
|
||||||
$iframe = 'https://v.qq.com/iframe/player.html?vid='.$vid[0];
|
$iframe = 'https://v.qq.com/iframe/player.html?vid='.$vid[0];
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,17 +9,18 @@ $checkurl = array('v.youku.com/v_show/');
|
||||||
function media_youku($url, $width, $height) {
|
function media_youku($url, $width, $height) {
|
||||||
$ctx = stream_context_create(array('http' => array('timeout' => 10)));
|
$ctx = stream_context_create(array('http' => array('timeout' => 10)));
|
||||||
if(preg_match("/^https?:\/\/v.youku.com\/v_show\/id_([^\/]+)(.html|)/i", $url, $matches)) {
|
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';
|
$params = explode('.', $matches[1]);
|
||||||
$iframe = 'https://player.youku.com/embed/'.$matches[1];
|
$flv = 'https://player.youku.com/player.php/sid/'.$params[0].'/v.swf';
|
||||||
if(!$width && !$height) {
|
$iframe = 'https://player.youku.com/embed/'.$params[0];
|
||||||
$api = 'http://v.youku.com/player/getPlayList/VideoIDS/'.$matches[1];
|
if(!$width && !$height) {
|
||||||
$str = stripslashes(file_get_contents($api, false, $ctx));
|
$api = 'http://v.youku.com/player/getPlayList/VideoIDS/'.$params[0];
|
||||||
if(!empty($str) && preg_match("/\"logo\":\"(.+?)\"/i", $str, $image)) {
|
$str = stripslashes(file_get_contents($api, false, $ctx));
|
||||||
$url = substr($image[1], 0, strrpos($image[1], '/')+1);
|
if(!empty($str) && preg_match("/\"logo\":\"(.+?)\"/i", $str, $image)) {
|
||||||
$filename = substr($image[1], strrpos($image[1], '/')+2);
|
$url = substr($image[1], 0, strrpos($image[1], '/')+1);
|
||||||
$imgurl = $url.'0'.$filename;
|
$filename = substr($image[1], strrpos($image[1], '/')+2);
|
||||||
}
|
$imgurl = $url.'0'.$filename;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return array($flv, $iframe, $url, $imgurl);
|
return array($flv, $iframe, $url, $imgurl);
|
||||||
}
|
}
|
Loading…
Reference in New Issue