这些函数是在一个视频站点中复制下来的,发布出来做一个备份,也许以后能用的上,至于函数的作用可以看一下具体代码,这里就不做解析了。
//解密js escape加密字符串 function unescape($str) { $ret = ''; $len strlen $str ); for$i 0 $i < $len++) if$str [$i]=='%'&&+1'u' $val hexdec substr $str,24 $val 0x7f $ret .= chr $val else 0x8000xc0|>>6.0x80&0x3f0xe012(( $i +=5 }'%' $ret urldecode $i3]; return $ret //获取视频搜索结果列表 get_videolist){ global $cfg_cmsurl $result=""foreachexplode('$@#$'as $item iftrim$item)==continue $arr'$#' $link$cfg_cmsurl."/play/"$arr[ $title $imgget_local_img]); $time3 $result.='原文链接:https://www.f2er.com/dedecms/451603.html$link '" class="img" title="'$title'" > $img'" width="165" alt="''" height="124" /> ' $result //获得视频详细信息html get_videodetail $nianfen $pingfen4 $starget_star_html$pingfen $column $status $zhuyanstr_replace'/'7 $diqu8 $leixing9 $intro10''" width="128" height="182" alt="''">nofollow" href="''">''$column') '$nianfen'$zhuyan'$status'$leixing'$diqu'$intro''" rel="nofollow">详细剧情快速观看" rel="nofollow" href="''" class="playlink">'/plus/desktop.html?name=''" rel="nofollow" class="desktop">$star' ' get_star_html $cfg_templets_skin $star0=(int)(/ $star1)((-)/ $star2=$star0$star1 $html ++){ $html'$cfg_templets_skin'/images/star0.gif">' $star2'/images/star2.gif">''/images/star1.gif">' $html get_local_img$url $result(!strstr'http://')&&!'/images/defaultpic.gif')){ $result elseif //将远程地址替换为伪静态地址 $filenamebasename $result'/static/'$filename curl_get$gzip=false $curl curl_init(); curl_setopt$curl CURLOPT_URL $url CURLOPT_SSL_VERIFYPEER //抓取https网页 curl_setopt CURLOPT_SSL_VERIFYHOST CURLOPT_HEADER CURLOPT_REFERER CURLOPT_USERAGENT'Mozilla/4.0 (compatible; MSIE 6.0; SeaPort/1.2; Windows NT 5.1; SV1; InfoPath.2)' curl_setopt CURLOPT_COOKIEJAR'cookie.txt' CURLOPT_COOKIEFILE CURLOPT_RETURNTRANSFER CURLOPT_FOLLOWLOCATION curl_setopt CURLOPT_ENCODING"gzip" $values curl_exec curl_closereturn$values curl_post$post CURLOPT_POST);//post提交方式 CURLOPT_POSTFIELDS $post //指定post提交的参数 $values get_baidu_keys$type=="all""http://top.baidu.com/buzz?b=1" elseif"week""http://top.baidu.com/buzz?b=42" $htmlcurl_geticonv"GB2312""UTF-8//IGNORE"$html preg_match_all'/ $data $data get_rewrite_url $rewriteArr$db $re"list.PHP" preg_match'/list.PHP\?tid=([\d]+)/' $id $sn$rewriteArr$id $repreg_replace'/plus\/list.PHP\?tid=([\d]+)/'$sn"view.PHP"'/view.PHP\?aid=([\d]+)/' //查询出sn $row->GetOne"select urlsn from dede_addonmovie where aid=$id"isset$row['urlsn'])) $sn'/plus\/view.PHP\?aid=([\d]+)/' $re get_filter_title$typename $sn $arrarray_flip $tid'剧')&&$tid== $re