注意,56.com与其他国内站点不同在于:他们已经用js脚本输出所有重要内容,从而基本杜绝了简单页面分析获取swf位置的可能性(也就是说,缩略图和swf位置都需要用户手工粘贴)。

另外,因为seyret对函数命名根据域名来进行,则函数名应为56getvideodetails(),这显然会造成一些问题,为支持此插件,seyret.php核心文件亦需作相相应在改变,即在分析URL中域名时,若域名为数字头,则应在调用的函数名前加www(这是临时解决方案),从根本上解决应当改成调用所有函数时,不论域名是否为数字起,均在域名前加同样字符,但这恐又会对既有插件的改名需求而造成一定混乱,因此,此处采用此方案。

代码修改如下:

查找seyret.php中所有

$functionname = $fvtype . "embed";

在此行前加

  //added by kolidon... like 56.com
  $fvtype = preg_match("/^([\d]+)[.]*$/", $fvtype)>0 ? "www".$fvtype : $fvtype;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
/**
// youku plugin for Seyret component//
* Content code
* All rights reserved
* Seyret Component is Free Software
* Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* by kolidon http://blog.treeber.com
* @Copyright (C) 2008 kolidon@gmail.com
*/
// no direct access
defined(’_VALID_MOS’) or die(’couldn\’t direct access’);
 
$videodownloadsupport = “no”;
$downloadcachingnotimeout = “no”;
$downloadcachingtimeout =60″;
 
//modified by kolidon…
//accept picturelink&smallvideocode
//function www56getvideodetails($vidlink, $existingcode, $categorylist, $reqtype)
function www56getvideodetails($vidlink, $existingcode, $categorylist, $reqtype, $picturelink, $smallvideocode)
{
 echo(::.$vidlink.<br />);
 global $database, $mosConfig_absolute_path, $mosConfig_live_site, $my;
 require_once($mosConfig_absolute_path ./administrator/components/com_seyret/seyret_config.php’);
 
 // http://www.56.com/u49/v_MzM2NzMzMjY.html
 // http://www.56.com/u20/v_MjkxOTQwOTc.html
 //attention: there is no relationship beetween the vidlink and the player link, so we use the all player url as smallservercode;
 //http://www.56.com/n_v139_/c32_/29_/26_/ws3228896_/120315152843_/1226580_/0_/29194097.swf
 
 /*
 <script type=”text/javascript”>
 var uvHost = “h19″;
 var _page_ = {channel:’show_flv’};
 var _oFlv_c = {’tag’ : ‘负离子 ‘, ‘tags0′ : ‘负离子 ‘, ‘tags1′ : ‘ ‘, ‘tags2′ : ‘ ‘, ‘tags3′ : ‘ ‘, ‘tags4′ : ‘ ‘, ‘Subject’ : ‘离子医学 02 ‘, ‘Content’ : ‘离子医学  \r\n       \r\n     \r\n\r\nn 《离子医学》是一门集电子学、物理化学、材料工学、高分子学、生命科学及临床医学等学科融为一体的跨学科的科学。创始人为日本堀口N 医学博士。\r\n\r\n \r\n\r\nn 现代社会自然生态环境的严重破坏,使人类进入了亚健康时代,人们的自然免疫能力和对疾病的自然治愈能力正在衰退,现代临床医学为此已步入了僵局。\r\n\r\n \r\n\r\nn 离子医学界的专家们认为,现代医学理念的“疾病治疗”主要是依靠各类药物的作用,而各类药物在发挥作用的同时,其副作用又是以损坏患者部分机体功能并加速其衰老为代价,来寻求患者病灶部位暂时的平衡。即使非常先进的现代医学,也并不能从真正意义上治好疾病,其结果往往是药物的副作用加速了生命体细胞组织的老化。\r\n\r\n \r\n\r\nn 离子医学研究阐明生命体的酸性、氧化是除遗传因素之外的各种现代疾病产生的根源。  \r\n\r\n \r\n\r\n  ● 其机理之一:现代社会生命体因长期精神紧张、不安而引 起中枢性,末梢  感神经持续紧张,末梢循环血液障碍,  基产生量增加,从而导致细胞内外的酸性氧化亢进;\r\n\r\n \r\n\r\n ● 机理之二:劳累过度,乳酸蓄积之后引起肌肉紧张,肩膀疼痛,头痛,失眠等症状,是由于正离子而引起的细胞的氧化,降低了激素分泌,免疫功能,以及体液循环,加快了老化,致使组织细胞的衰退;\r\n\r\n  \r\n\r\n   ● 机理之三:地球生态环境的破坏,紫外线的增强、电子产 品的电磁波、静电的环境等使负离子量明显减少,从而助长了生命体的酸性和氧化;\r\n\r\n  \r\n\r\n   ● 机理之四:酸性食品的过度摄入,产生自体内的有毒的活性氧(  基)等致使细胞加剧了氧化。\r\n\r\n \r\n\r\n n 离子医学研究者认为,对生命体给与自然界的能量—负离子(还原电子),可使破环生命体健康的酸性、氧化、活性氧、乳酸等因素逐渐减少,激活细胞组织的新陈代谢,给生命体内部创造良好的环境,造就健康的身体。从而加强生命体自身的恢复力与自然治愈能力,进而克服疾病,以这个宇宙生命根源的原理为准则的还原电子治疗法,可以无副作用并根本性的治愈疾病,因此,可以说还原电子治疗法是治疗医学,也是预防医学。\r\n\r\n \r\n\r\n离子医学的产生和发展将是人类重新找回健康的唯一途径,是二十一世纪最伟大的尖端科学。 ‘, ‘user_name’ : ’shserumi ‘};
 document.title = “离子医学 02  - 56网视频”;
 </script>
 */
 
 if ($reqtype ==new) {
  $vidlink = jalemurldecode($vidlink);
 
 }
 
 else if ($reqtype == “refresh”) {
  // 56.com is special, use the param
 }
 
 $videoservertype =56″;
 
 // the video page
 $str = jalem_file_get_contents($vidlink);
 $str = mb_convert_encoding($str, “UTF-8, “GBK”);
 // tag,subject,content,user_name
 $pattern0 =<head>[^\f]*?var _oFlv_c = \{([^\f]*?’)\};[^\f]*?</script>[^\f]*?</head>”;
 if(mb_eregi($pattern0, $str, $arr_videotemp)){
  $str_temp = $arr_videotemp[1];
  // maybe some commas and single quotes in content, so we user mb_eregi
  if(mb_eregi((’tag’ :[^\f]*?), ‘Subject”,$str_temp, $arr_itemtemp)>0){
   $videotags = mb_eregi_replace(”tag[s]?[\d]*,,$arr_itemtemp[1]);
   $videotags = mb_eregi_replace([,':\s]+”,’,',$videotags);
   while(strpos($videotags,,,)!==false){
    $videotags = str_replace(,,,,, $videotags);
   }
  }
  if(mb_eregi(”‘Subject’([^\f]*?), ‘Content”,$str_temp, $arr_itemtemp)>0){
   $videotitle = $arr_itemtemp[1];
   $videotitle = mb_eregi_replace([':,]+”,’ ‘,$videotitle);
   while(strpos($videotitle, “  “)!==false){
    $videotitle = str_replace(”  “,” “, $videotitle);
   }
   $videotitle = trim($videotitle);
  }
  if(mb_eregi(”‘Content’([^\f]*?), ‘user_name”,$str_temp, $arr_itemtemp)>0){
   $itemcomment = $arr_itemtemp[1];
   // the first and the trail quote
   //$itemcomment = mb_eregi_replace(”[,':\s],,',$itemcomment);
 
   while(mb_eregi(”^([,':\s])+, $itemcomment)>0){
    $itemcomment = mb_substr($itemcomment, 1);
   }
   while(mb_eregi(”^.*([,':\s])+$”, $itemcomment)>0){
    $itemcomment = mb_substr($itemcomment, 0, mb_strlen($itemcomment)-2);
   }
 
   $itemcomment = str_replace(’\r\n’, “<br />”, $itemcomment);
  }
  if(mb_eregi(”‘user_name’ : [^\f]*?’, ‘Content”,$str_temp, $arr_itemtemp)>0){
   $user_name = $arr_itemtemp[1];  // extensible
  }
 }
 if ($reqtype == “new”) {
  $renderinputform = renderinputform_kolidon($vidlink, $picturelink, $videotitle, $itemcomment, $categorylist, $videoservertype, $smallvideocode, $videotags);
  return $renderinputform;
 } else if ($reqtype == “refresh”) {
  return array ($picturelink, $videotitle, $itemcomment);
 } else if ($reqtype == “newdirectadd”) {
  // by kolidon
  // to do: query the videoitem table to determine the $vidlink is no double
  $renderresult = savevideoitem_kolidon($vidlink, $picturelink, $videotitle, $itemcomment, $categorylist, $videoservertype, $smallvideocode, $videotags);
  return $renderresult;
 }
}
 
function www56embed($vcode, $vthumb, $downloadcachingnotimeout, $downloadcachingtimeout, $pro, $catid, $setwidth = null, $setheight = null)
{
 global $mosConfig_absolute_path, $mosConfig_live_site;
 require($mosConfig_absolute_path . ‘/administrator/components/com_seyret/seyret_config.php’);
 
 $dlink = “”;
 $unexpectederror = “”;
 $fullmd5cachefile = “”;
 $vdlink = “”;
 
 $vcode = jalemurldecode($vcode);
 
 $vidwindow = mosGetParam($_REQUEST, ‘vidwindow’, null);
 if ($vidwindow == “popup”) {
  $videowidth = $popupvideowidth;
  $videoheight = $popupvideoheight;
 }
 
 if ($setwidth > 0 AND $setheight > 0) {
  $videowidth = $setwidth;
  $videoheight = $setheight;
 }
 
 $pos404 = strpos($vdlink, “NotFound”);
 $unexpectederror = “”;
 if (!file_exists($fullmd5cachefile) AND $vdlink == “”) $unexpectederror = “1″;
 if ($pos404 > 0) $unexpectederror = “1″;
 
 if ($pro <> “1″ OR $unexpectederror == “1″) {
  $embedvideo = ‘
   <embed src=”‘.$vcode.’”  type=”application/x-shockwave-flash” width=”‘.$videowidth.’” height=”‘.$videoheight.’”></embed>
  ’;
 }
 
 return $embedvideo;
}
 
function www56generatevideodownloadlink($vcode, $pro, $dltask)
{
 global $database, $mosConfig_live_site, $mosConfig_absolute_path;
 
 $vtype = “youku”;
 
 $database->setQuery(”SELECT joomlaalemuserid FROM #__seyret_check”);
 $check = $database->loadObjectList();
 foreach ($check as $check) {
  $joomlaalemuserid = $check->joomlaalemuserid;
 }
 $siteforjoomlaalem = $mosConfig_live_site;
 $siteforjoomlaalem = jalemurlencode($siteforjoomlaalem);
 
 if ($pro == “1″) {
  $pro_file = $mosConfig_absolute_path . “/administrator/components/com_seyret/sql/pro/spphp.php”;
  require_once($pro_file);
  $str = generateprodlink($vtype, $vcode);
 
  $pos = strpos($str, “<prolink>”) + 9;
  $post = strpos($str, “</prolink>”) - $pos;
  $dlink = substr($str, $pos, $post);
 
  $pos = strpos($str, “<dltype>”) + 8;
  $post = strpos($str, “</dltype>”) - $pos;
  $dtype = substr($str, $pos, $post);
 
  if ($dltask <> “embed”) {
   if ($dtype == “script”) {
    $downlink = “<script>self.location = \”" . $dlink . “\”;</script>”;
   } else if ($dtype == “save”) {
    $downlink = “<a href=\”" . $dlink . “\”>” . _RIGHTCLICKANDSAVE . “</a>”;
   }
   return $downlink;
  } else {
   return $str;
  }
 } else {
  $func = “generatedownloadlink”;
  $link = “http://www.joomla-alem.com/index2.php?option=com_joomlaalem&no_html=1&task=” . $func . “&siteinfo=” . $siteforjoomlaalem . “&jalemuserid=” . $joomlaalemuserid . “&vtype=” . $vtype . “&vcode=” . $vcode;
  $videodownloadlink = jalem_file_get_contents($link);
  return $videodownloadlink;
 }
}
 
?>