sharetronix 1.5 支持国内视频

有的朋友升级到 1.5 后 sharetronix 不能播放 优酷,土豆等国内视频了,下面给出解决方法。

 

需要准备

1。国内视频字典文件 /system/conf_embed.php

2。修改/system/controllers/ajax_postform-attach.php  中的部分代码。是的提交国内视频地址的时候,可以通过认证。

 

下面是 具体操作:

 

1.文件/system/conf_embed.php,替换原有的

<?php global $C; $C->NEWPOST_EMBEDVIDEO_SOURCES = array ( 'youku' => (object) array ( 'url_patterns' => (object) array ( '/http(s)?:////player/.youku/.com//player/.php//sid//(/w{13}?)//v/.swf/i' => 2, '/^http(s)?:////v/.youku/.com//v_show//id_(/w{13}?)/.html/i' => 2, '/^http(s)?:////v/.youku/.com//v_show//id_(/w{13}?)_rss/.html/i' => 2 ), 'embed_w' => 480, 'embed_h' => 400, 'embed_code' => '<embed src="http://player.youku.com/player.php/sid/###ID###/v.swf" mce_src="http://player.youku.com/player.php/sid/###ID###/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>', 'embed_thumb' => '###REMOTE###', 'insite_url' => 'http://v.youku.com/v_show/id_###ID###.html' ), 'tudou' => (object) array ( 'url_patterns' => (object) array ( '/^http(s)?/:////(www/.)?(tudou/.com)//programs//view//([a-z0-9-_]{3,})/i' => 4, '/^http(s)?/:////www/.tudou/.com//v//([a-z0-9-_]{3,})/i' => 2 ), 'embed_w' => 420, 'embed_h' => 363, 'embed_code' => '<object width="420" height="363"><param name="movie" value="http://www.tudou.com/v/###ID###"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque"></param><embed src="http://www.tudou.com/v/###ID###" mce_src="http://www.tudou.com/v/###ID###" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="opaque" width="420" height="363"></embed></object>', 'embed_thumb' => '###REMOTE###', 'insite_url' => 'http://www.tudou.com/v/###ID###', ), 'ku6' => (object) array ( 'url_patterns' => (object) array ( '/^http(s)?:////v/.ku6/.com//special//show_(/d{7})//([-/w]{16}).html/i' => 3, '/^http(s)?:////v/.ku6/.com//show//([-/w]{16}).html/i' => 2, '/^http(s)?:////player/.ku6/.com//refer//([-/w]{16})//v/.swf/i' => 2 ), 'embed_w' => 480, 'embed_h' => 400, 'embed_code' => '<embed src="http://player.ku6.com/refer/###ID###/v.swf" mce_src="http://player.ku6.com/refer/###ID###/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" allowfullscreen="true" type="application/x-shockwave-flash"></embed>', 'embed_thumb' => '###REMOTE###', 'insite_url' => 'http://v.ku6.com/show/###ID###.html', ), '56' => (object) array ( 'url_patterns' => (object) array ( '/^http(s)?:////www/.56/.com//u(/d{2})//v_(/w{8,11})/.html/i' => 3, '/^http(s)?:////www/.56/.com//w(/d{2})//play_album/-aid/-(/d{7})_vid-(/w{11})/.html/i' => 4, '/^http(s)?:////player/.56/.com//v_(/w{7,11})/.swf/i' => 2 ), 'embed_w' => 480, 'embed_h' => 395, 'embed_code' => '<embed src="http://player.56.com/v_###ID###.swf" mce_src="http://player.56.com/v_###ID###.swf" type="application/x-shockwave-flash" width="480" height="395"></embed>', 'embed_thumb' => '###REMOTE###', 'insite_url' => 'http://www.56.com/u99/v_###ID###.html', ), 'joy' => (object) array ( 'url_patterns' => (object) array ( '/^http(s)?:////(/w+)/.joy/.cn//video//(/d{7})/.htm/i' => 3, '/^http(s)?:////client/.joy/.cn//flvplayer//(/d{7})_1_0_1/.swf/i' => 2, '/^http(s)?://///w+/.joy/.cn//Album///d{6}///d///d//(/d{7})/.htm/i' => 2, ), 'embed_w' => 480, 'embed_h' => 400, 'embed_code' => '<embed src="http://client.joy.cn/flvplayer/###ID###_1_0_1.swf" mce_src="http://client.joy.cn/flvplayer/###ID###_1_0_1.swf"quality="high" width="480" height="400" align="middle"allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>', 'embed_thumb' => '###REMOTE###', 'insite_url' => 'http://you.joy.cn/video/###ID###.htm', ) ); ?>

 

 

 

 

 

2。修改/system/controllers/ajax_postform-attach.php  ,在270行左右

/* z修改,支持国内视频 foreach($S as $k=>$obj) { if( preg_match($obj->src_url_pattern, $video, $matches) ) { $data->src_id = $matches[$obj->src_url_matchnum]; $data->src_site = $k; break; } elseif( preg_match($obj->src_emb_pattern, $video, $matches) ) { $data->src_id = $matches[$obj->src_emb_matchnum]; $data->src_site = $k; break; } } */ $Matched = FALSE; foreach($S as $k=>$obj) { foreach($obj->url_patterns as $url=>$matches_num) { if( preg_match($url, $video, $matches) ) { $data->src_id = $matches[$matches_num]; $data->src_site = $k; $Matched = TRUE; break; } } if($Matched) break; }

 

 

 

 

你可能感兴趣的:(sharetronix 1.5 支持国内视频)