First commit
This commit is contained in:
0
source/function/media/index.htm
Normal file
0
source/function/media/index.htm
Normal file
24
source/function/media/media_56.php
Normal file
24
source/function/media/media_56.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('www.56.com');
|
||||
|
||||
function media_56($url, $width, $height) {
|
||||
if(preg_match("/^http:\/\/www.56.com\/\S+\/play_album-aid-(\d+)_vid-(.+?).html/i", $url, $matches)) {
|
||||
$flv = 'http://player.56.com/v_'.$matches[2].'.swf';
|
||||
$matches[1] = $matches[2];
|
||||
} elseif(preg_match("/^http:\/\/www.56.com\/\S+\/([^\/]+).html/i", $url, $matches)) {
|
||||
$flv = 'http://player.56.com/'.$matches[1].'.swf';
|
||||
}
|
||||
if(!$width && !$height && !empty($matches[1])) {
|
||||
$api = 'http://vxml.56.com/json/'.str_replace('v_', '', $matches[1]).'/?src=out';
|
||||
$str = dfsockopen($api);
|
||||
if(!empty($str) && preg_match("/\"img\":\"(.+?)\"/i", $str, $image)) {
|
||||
$imgurl = trim($image[1]);
|
||||
}
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
22
source/function/media/media_acfun.php
Normal file
22
source/function/media/media_acfun.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('acfun.cn', 'acfun.tv');
|
||||
|
||||
function media_acfun($url, $width, $height) {
|
||||
if(preg_match("/https?:\/\/(www.|)acfun.(cn|tv)\/v\/ac(\d+)/i", $url, $matches)) {
|
||||
$vid = $matches[3];
|
||||
$flv = '';
|
||||
$iframe = 'https://www.acfun.cn/player/ac'.$vid;
|
||||
$imgurl = '';
|
||||
} elseif(preg_match("/https?:\/\/m.acfun.(cn|tv)\/v\/\?ac=(\d+)/i", $url, $matches)) {
|
||||
$vid = $matches[2];
|
||||
$flv = '';
|
||||
$iframe = 'https://www.acfun.cn/player/ac'.$vid;
|
||||
$imgurl = '';
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
22
source/function/media/media_bilibili.php
Normal file
22
source/function/media/media_bilibili.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('bilibili.com/video/', 'bilibili.tv/video/', 'acg.tv', 'b23.tv');
|
||||
|
||||
function media_bilibili($url, $width, $height) {
|
||||
if(preg_match("/https?:\/\/(m.|www.|)bilibili.(com|tv)\/video\/(a|b)v([A-Za-z0-9]+)(\/?.*?&p=|\/?\?p=)?(\d+)?/i", $url, $matches)) {
|
||||
$vid = (is_numeric($matches[4]) ? 'aid='.$matches[4] : 'bvid='.$matches[4]) . (empty($matches[6]) ? '' : '&page='.intval($matches[6]));
|
||||
$flv = '';
|
||||
$iframe = 'https://player.bilibili.com/player.html?'.$vid.'&autoplay=0';
|
||||
$imgurl = '';
|
||||
} else if(preg_match("/https?:\/\/(www.|)(acg|b23).tv\/(a|b)v([A-Za-z0-9]+)(\/?.*?&p=|\/?\?p=)?(\d+)?/i", $url, $matches)) {
|
||||
$vid = (is_numeric($matches[4]) ? 'aid='.$matches[4] : 'bvid='.$matches[4]) . (empty($matches[6]) ? '' : '&page='.intval($matches[6]));
|
||||
$flv = '';
|
||||
$iframe = 'https://player.bilibili.com/player.html?'.$vid.'&autoplay=0';
|
||||
$imgurl = '';
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
15
source/function/media/media_ixigua.php
Normal file
15
source/function/media/media_ixigua.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('ixigua.com/');
|
||||
|
||||
function media_ixigua($url, $width, $height) {
|
||||
if(preg_match("/^https?:\/\/(|m.|www.)ixigua.com\/(\d+)/i", $url, $matches)) {
|
||||
$iframe = 'https://www.ixigua.com/iframe/'.$matches[2].'?autoplay=0';
|
||||
$flv = $imgurl = '';
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
30
source/function/media/media_ku6.php
Normal file
30
source/function/media/media_ku6.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('v.ku6.com/show/', 'v.ku6.com/special/show_');
|
||||
|
||||
function media_ku6($url, $width, $height) {
|
||||
if(preg_match("/^http:\/\/v.ku6.com\/show\/([^\/]+).html/i", $url, $matches)) {
|
||||
$flv = 'http://player.ku6.com/refer/'.$matches[1].'/v.swf';
|
||||
if(!$width && !$height) {
|
||||
$api = 'http://vo.ku6.com/fetchVideo4Player/1/'.$matches[1].'.html';
|
||||
$str = dfsockopen($api);
|
||||
if(!empty($str) && preg_match("/\"picpath\":\"(.+?)\"/i", $str, $image)) {
|
||||
$imgurl = str_replace(array('\u003a', '\u002e'), array(':', '.'), $image[1]);
|
||||
}
|
||||
}
|
||||
} elseif(preg_match("/^http:\/\/v.ku6.com\/special\/show_\d+\/([^\/]+).html/i", $url, $matches)) {
|
||||
$flv = 'http://player.ku6.com/refer/'.$matches[1].'/v.swf';
|
||||
if(!$width && !$height) {
|
||||
$api = 'http://vo.ku6.com/fetchVideo4Player/1/'.$matches[1].'.html';
|
||||
$str = dfsockopen($api);
|
||||
if(!empty($str) && preg_match("/\"picpath\":\"(.+?)\"/i", $str, $image)) {
|
||||
$imgurl = str_replace(array('\u003a', '\u002e'), array(':', '.'), $image[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
17
source/function/media/media_mgtv.php
Normal file
17
source/function/media/media_mgtv.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('mgtv.com/b/', 'hunantv.com/b/');
|
||||
|
||||
function media_mgtv($url, $width, $height) {
|
||||
if(preg_match("/https?:\/\/(m.|www.|)(mg|hunan)tv.com\/b\/(\d+)\/(\d+).html/i", $url, $matches)) {
|
||||
$vid = $matches[4];
|
||||
$flv = 'https://player.mgtv.com/mgtv_v6_out/main.swf?video_id='.$vid;
|
||||
$iframe = '';
|
||||
$imgurl = '';
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
22
source/function/media/media_qq.php
Normal file
22
source/function/media/media_qq.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$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]);
|
||||
$flv = 'https://imgcache.qq.com/tencentvideo_v1/playerv3/TPout.swf?vid='.$vid[0];
|
||||
$iframe = 'https://v.qq.com/txp/iframe/player.html?vid='.$vid[0];
|
||||
$imgurl = '';
|
||||
} else if(preg_match("/https?:\/\/v.qq.com\/x\/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/txp/iframe/player.html?vid='.$vid[0];
|
||||
$imgurl = '';
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
30
source/function/media/media_sina.php
Normal file
30
source/function/media/media_sina.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('video.sina.com.cn/v/b/', 'you.video.sina.com.cn/b/');
|
||||
|
||||
function media_sina($url, $width, $height) {
|
||||
if(preg_match("/^http:\/\/video.sina.com.cn\/v\/b\/(\d+)-(\d+).html/i", $url, $matches)) {
|
||||
$flv = 'http://vhead.blog.sina.com.cn/player/outer_player.swf?vid='.$matches[1];
|
||||
if(!$width && !$height) {
|
||||
$api = 'http://interface.video.sina.com.cn/interface/common/getVideoImage.php?vid='.$matches[1];
|
||||
$str = dfsockopen($api);
|
||||
if(!empty($str)) {
|
||||
$imgurl = str_replace('imgurl=', '', trim($str));
|
||||
}
|
||||
}
|
||||
} elseif(preg_match("/^http:\/\/you.video.sina.com.cn\/b\/(\d+)-(\d+).html/i", $url, $matches)) {
|
||||
$flv = 'http://vhead.blog.sina.com.cn/player/outer_player.swf?vid='.$matches[1];
|
||||
if(!$width && !$height) {
|
||||
$api = 'http://interface.video.sina.com.cn/interface/common/getVideoImage.php?vid='.$matches[1];
|
||||
$str = dfsockopen($api);
|
||||
if(!empty($str)) {
|
||||
$imgurl = str_replace('imgurl=', '', trim($str));
|
||||
}
|
||||
}
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
30
source/function/media/media_sohu.php
Normal file
30
source/function/media/media_sohu.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('my.tv.sohu.com/u/', 'v.blog.sohu.com/u/');
|
||||
|
||||
function media_sohu($url, $width, $height) {
|
||||
if(preg_match("/^http:\/\/my.tv.sohu.com\/u\/[^\/]+\/(\d+)/i", $url, $matches)) {
|
||||
$flv = 'http://v.blog.sohu.com/fo/v4/'.$matches[1];
|
||||
if(!$width && !$height) {
|
||||
$api = 'http://v.blog.sohu.com/videinfo.jhtml?m=view&id='.$matches[1].'&outType=3';
|
||||
$str = dfsockopen($api);
|
||||
if(!empty($str) && preg_match("/\"cutCoverURL\":\"(.+?)\"/i", $str, $image)) {
|
||||
$imgurl = str_replace(array('\u003a', '\u002e'), array(':', '.'), $image[1]);
|
||||
}
|
||||
}
|
||||
} elseif(preg_match("/^http:\/\/v.blog.sohu.com\/u\/[^\/]+\/(\d+)/i", $url, $matches)) {
|
||||
$flv = 'http://v.blog.sohu.com/fo/v4/'.$matches[1];
|
||||
if(!$width && !$height) {
|
||||
$api = 'http://v.blog.sohu.com/videinfo.jhtml?m=view&id='.$matches[1].'&outType=3';
|
||||
$str = dfsockopen($api);
|
||||
if(!empty($str) && preg_match("/\"cutCoverURL\":\"(.+?)\"/i", $str, $image)) {
|
||||
$imgurl = str_replace(array('\u003a', '\u002e'), array(':', '.'), $image[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
21
source/function/media/media_tudou.php
Normal file
21
source/function/media/media_tudou.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('tudou.com/programs/view/');
|
||||
|
||||
function media_tudou($url, $width, $height) {
|
||||
if(preg_match("/^http:\/\/(www.)?tudou.com\/programs\/view\/([^\/]+)/i", $url, $matches)) {
|
||||
$flv = 'http://www.tudou.com/v/'.$matches[2];
|
||||
$iframe = 'http://www.tudou.com/programs/view/html5embed.action?code='.$matches[2];
|
||||
if(!$width && !$height) {
|
||||
$str = dfsockopen($api);
|
||||
if(!empty($str) && preg_match("/<span class=\"s_pic\">(.+?)<\/span>/i", $str, $image)) {
|
||||
$imgurl = trim($image[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
17
source/function/media/media_wasu.php
Normal file
17
source/function/media/media_wasu.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('wasu.cn');
|
||||
|
||||
function media_wasu($url, $width, $height) {
|
||||
if(preg_match("/https?:\/\/(www.|)wasu.cn\/(wap\/|)Play\/show\/id\/(\d+)/i", $url, $matches)) {
|
||||
$vid = $matches[3];
|
||||
$flv = '';
|
||||
$iframe = 'https://www.wasu.cn/Play/iframe/id/'.$vid;
|
||||
$imgurl = '';
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
26
source/function/media/media_youku.php
Normal file
26
source/function/media/media_youku.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$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)) {
|
||||
$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(dfsockopen($api));
|
||||
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);
|
||||
}
|
23
source/function/media/media_youtube.php
Normal file
23
source/function/media/media_youtube.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
if(!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
$checkurl = array('youtube.com/watch?');
|
||||
|
||||
function media_youtube($url, $width, $height) {
|
||||
if(preg_match("/^https?:\/\/(|m.|www.)youtube.com\/watch\?v=([^\/&]+)&?/i", $url, $matches)) {
|
||||
$flv = 'https://www.youtube.com/v/'.$matches[2].'&fs=1';
|
||||
$iframe = 'https://www.youtube.com/embed/'.$matches[2];
|
||||
if(!$width && !$height) {
|
||||
$str = dfsockopen($url);
|
||||
if(!empty($str) && preg_match("/'VIDEO_HQ_THUMB':\s'(.+?)'/i", $str, $image)) {
|
||||
$url = substr($image[1], 0, strrpos($image[1], '/')+1);
|
||||
$filename = substr($image[1], strrpos($image[1], '/')+3);
|
||||
$imgurl = $url.$filename;
|
||||
}
|
||||
}
|
||||
}
|
||||
return array($flv, $iframe, $url, $imgurl);
|
||||
}
|
Reference in New Issue
Block a user