From c1bed9ed46486f54ee45e86a32d810b345cd121b Mon Sep 17 00:00:00 2001 From: david082321 <7046617+david082321@users.noreply.github.com> Date: Fri, 16 Dec 2022 01:36:11 +0800 Subject: [PATCH] Refine code --- config.php | 2 +- index.php | 4 +- intl/gateway/v2/app/search/type/index.php | 2 +- intl/gateway/v2/app/search/v2/index.php | 2 +- intl/gateway/v2/app/subtitle/index.php | 2 +- intl/gateway/v2/ogv/playurl/index.php | 4 +- .../gateway/v2/ogv/view/app/episode/index.php | 2 +- intl/gateway/v2/ogv/view/app/season/index.php | 2 +- .../gateway/v2/ogv/view/app/season2/index.php | 2 +- intl/gateway/web/v2/subtitle/index.php | 2 +- pgc/player/api/playurl/index.php | 6 +-- pgc/player/web/playurl/index.php | 6 +-- pgc/view/web/season/index.php | 4 +- utils/auth.php | 2 +- utils/fuck_search.php | 4 +- utils/fuck_sub.php | 14 +++--- utils/functions.php | 14 +++--- utils/functions_cache.php | 46 +++++++++---------- utils/process.php | 4 +- utils/refresh_token_th.php | 2 +- utils/replace.php | 4 +- utils/replace_playurl.php | 2 +- x/v2/search/type/index.php | 4 +- x/web-interface/search/type/index.php | 4 +- 24 files changed, 70 insertions(+), 70 deletions(-) diff --git a/config.php b/config.php index 376341a..b2dd54c 100644 --- a/config.php +++ b/config.php @@ -3,7 +3,7 @@ define('SYSTEM', TRUE); // 代码放置路径(通常不需要修改) -define('ROOT_PATH',$_SERVER['DOCUMENT_ROOT'].'/'); +define('ROOT_PATH', $_SERVER['DOCUMENT_ROOT'].'/'); // 封锁 define('BLOCK_TYPE', 'blacklist'); // 封锁类型:blacklist 在线黑名单, whitelist 在线白名单, local_blacklist 本地黑名单, local_whitelist 本地白名單, 不是填写前面几个就是不封锁 diff --git a/index.php b/index.php index 8d918f7..60c6657 100644 --- a/index.php +++ b/index.php @@ -17,7 +17,7 @@ include (ROOT_PATH."utils/process.php"); if ((CID != "" || EP_ID != "") && WEB_ON == 1) { // Web接口 $path = "/pgc/player/web/playurl"; - $host = get_host($type,$cache_type); + $host = get_host($type, $cache_type); } else { // 欢迎语 header('Content-Type: text/html; charset=utf-8'); @@ -46,7 +46,7 @@ if (IP_RESOLVE == 1) { // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } diff --git a/intl/gateway/v2/app/search/type/index.php b/intl/gateway/v2/app/search/type/index.php index 6ddcd3b..404eae0 100644 --- a/intl/gateway/v2/app/search/type/index.php +++ b/intl/gateway/v2/app/search/type/index.php @@ -26,7 +26,7 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } diff --git a/intl/gateway/v2/app/search/v2/index.php b/intl/gateway/v2/app/search/v2/index.php index 7e25c9a..7d6ec8e 100644 --- a/intl/gateway/v2/app/search/v2/index.php +++ b/intl/gateway/v2/app/search/v2/index.php @@ -26,7 +26,7 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } diff --git a/intl/gateway/v2/app/subtitle/index.php b/intl/gateway/v2/app/subtitle/index.php index 3e58207..43ada03 100644 --- a/intl/gateway/v2/app/subtitle/index.php +++ b/intl/gateway/v2/app/subtitle/index.php @@ -34,7 +34,7 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } diff --git a/intl/gateway/v2/ogv/playurl/index.php b/intl/gateway/v2/ogv/playurl/index.php index 42410a5..c7c4e0b 100644 --- a/intl/gateway/v2/ogv/playurl/index.php +++ b/intl/gateway/v2/ogv/playurl/index.php @@ -35,12 +35,12 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } // 412提醒 -check_412($output,$get_area); +check_412($output, $get_area); // 替换内容 include (ROOT_PATH."utils/replace.php"); // 返回内容给用户 diff --git a/intl/gateway/v2/ogv/view/app/episode/index.php b/intl/gateway/v2/ogv/view/app/episode/index.php index cb09c55..ab32a8c 100644 --- a/intl/gateway/v2/ogv/view/app/episode/index.php +++ b/intl/gateway/v2/ogv/view/app/episode/index.php @@ -28,7 +28,7 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } diff --git a/intl/gateway/v2/ogv/view/app/season/index.php b/intl/gateway/v2/ogv/view/app/season/index.php index 2787910..7eacbd0 100644 --- a/intl/gateway/v2/ogv/view/app/season/index.php +++ b/intl/gateway/v2/ogv/view/app/season/index.php @@ -34,7 +34,7 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } diff --git a/intl/gateway/v2/ogv/view/app/season2/index.php b/intl/gateway/v2/ogv/view/app/season2/index.php index 9c78199..aee3296 100644 --- a/intl/gateway/v2/ogv/view/app/season2/index.php +++ b/intl/gateway/v2/ogv/view/app/season2/index.php @@ -34,7 +34,7 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } diff --git a/intl/gateway/web/v2/subtitle/index.php b/intl/gateway/web/v2/subtitle/index.php index 6590798..e046e83 100644 --- a/intl/gateway/web/v2/subtitle/index.php +++ b/intl/gateway/web/v2/subtitle/index.php @@ -32,7 +32,7 @@ if (IP_RESOLVE == 1) { // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } diff --git a/pgc/player/api/playurl/index.php b/pgc/player/api/playurl/index.php index 07131ef..5aabccf 100644 --- a/pgc/player/api/playurl/index.php +++ b/pgc/player/api/playurl/index.php @@ -14,7 +14,7 @@ if (SAVE_CACHE == 1) { // 处理用户传入参数 include (ROOT_PATH."utils/process.php"); // 设置host -$host = get_host($type,$cache_type); +$host = get_host($type, $cache_type); // 锁区、web接口、X-From-Biliroaming include (ROOT_PATH."utils/lock_area.php"); // 鉴权、替换access_key、获取缓存 @@ -35,12 +35,12 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } // 412提醒 -check_412($output,$get_area); +check_412($output, $get_area); // 替换内容 include (ROOT_PATH."utils/replace.php"); // 返回内容给用户 diff --git a/pgc/player/web/playurl/index.php b/pgc/player/web/playurl/index.php index a1c72bd..4024228 100644 --- a/pgc/player/web/playurl/index.php +++ b/pgc/player/web/playurl/index.php @@ -14,7 +14,7 @@ if (SAVE_CACHE == 1) { // 处理用户传入参数 include (ROOT_PATH."utils/process.php"); // 设置host -$host = get_host($type,$cache_type); +$host = get_host($type, $cache_type); // 锁区、web接口、X-From-Biliroaming include (ROOT_PATH."utils/lock_area.php"); // 鉴权、替换access_key、获取缓存 @@ -35,12 +35,12 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } // 412提醒 -check_412($output,$get_area); +check_412($output, $get_area); // 替换内容 include (ROOT_PATH."utils/replace.php"); // 返回内容给用户 diff --git a/pgc/view/web/season/index.php b/pgc/view/web/season/index.php index f006277..e6e24d7 100644 --- a/pgc/view/web/season/index.php +++ b/pgc/view/web/season/index.php @@ -14,7 +14,7 @@ if (SAVE_CACHE == 1) { // 处理用户传入参数 include (ROOT_PATH."utils/process.php"); // 设置host -$host = get_host($type,$cache_type); +$host = get_host($type, $cache_type); // 锁区、web接口、X-From-Biliroaming include (ROOT_PATH."utils/lock_area.php"); // 鉴权、替换access_key、获取缓存 @@ -32,7 +32,7 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } diff --git a/utils/auth.php b/utils/auth.php index 930328a..1d21e34 100644 --- a/utils/auth.php +++ b/utils/auth.php @@ -129,7 +129,7 @@ if (ACCESS_KEY != "") { // access_key 存在 write_log(); } // 开始ban - $support_replace_type = array("hlw","tom","txbb","xyy","all","random"); // 允许替换的类型(兼容旧版config) + $support_replace_type = array("hlw", "tom", "txbb", "xyy", "all", "random"); // 允许替换的类型(兼容旧版config) if ($is_baned) { if (in_array(REPLACE_TYPE, $support_replace_type)) { include (ROOT_PATH."utils/replace_playurl.php"); diff --git a/utils/fuck_search.php b/utils/fuck_search.php index ec5af2a..b05c576 100644 --- a/utils/fuck_search.php +++ b/utils/fuck_search.php @@ -34,8 +34,8 @@ @$total = $array['data']['total']; @$pages = $array['data']['pages']; @$items_old = $array['data']['items']; - $items_new= trim(json_encode($items_old, 320),'[]'); - $items = str_replace('["追番","已追番"]','{"0":"追番","1":"已追番"}',$items_new); + $items_new= trim(json_encode($items_old, 320), '[]'); + $items = str_replace('["追番","已追番"]', '{"0":"追番","1":"已追番"}', $items_new); } else { $trackid = ""; $exp_str = ""; diff --git a/utils/fuck_sub.php b/utils/fuck_sub.php index 5e809e5..00aec90 100644 --- a/utils/fuck_sub.php +++ b/utils/fuck_sub.php @@ -71,14 +71,14 @@ } $sub_count = count($sub_arr); $add_arr = array( - "id"=>1, - "key"=>$key, - "title"=>"[非官方]".$lang."(".SUBTITLE_TEAM_NAME.")", - "url"=>"https://".$url, - "is_machine"=>false + "id" => 1, + "key" => $key, + "title" => "[非官方]".$lang."(".SUBTITLE_TEAM_NAME.")", + "url" => "https://".$url, + "is_machine" => false ); - array_unshift($sub_arr,$add_arr); //这个会放在前面 - //array_push($sub_arr,$add_arr); //这个会放在后面 + array_unshift($sub_arr, $add_arr); //这个会放在前面 + //array_push($sub_arr, $add_arr); //这个会放在后面 if ($ss_type == "result") { $array['result']['modules'][0]['data']['episodes'][$ep]['subtitles'] = $sub_arr; } else { diff --git a/utils/functions.php b/utils/functions.php index 54090dc..8a5d2ba 100644 --- a/utils/functions.php +++ b/utils/functions.php @@ -3,7 +3,7 @@ if(!defined('SYSTEM')) {exit();} $member_type = 0; // 判断用户状态 -function get_webpage($url,$host="",$ip="") { +function get_webpage($url, $host="", $ip="") { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); if (PROXY_ON == 1) { // 指定代理 @@ -55,7 +55,7 @@ function get_blacklist($uid) { return $output; } -function get_host($type,$cache_type) { +function get_host($type, $cache_type) { switch ($type) { case 1: // playurl switch (AREA) { @@ -154,7 +154,7 @@ function get_userinfo() { } // 412 提醒 -function check_412($output,$get_area) { +function check_412($output, $get_area) { if (TG_NOTIFY == 1) { $status = json_decode($output, true); $msg = ""; @@ -167,12 +167,12 @@ function check_412($output,$get_area) { if ($latest_code != $status['code']) { if ($status['code'] == -412) { $msg = '破服务器412啦,地区:' . $get_area; - write_status($status['code'],$get_area); + write_status($status['code'], $get_area); } else { if ($latest_code == -412) { $msg = '破服务器恢复啦,地区:' . $get_area; } - write_status(0,$get_area); + write_status(0, $get_area); } } } @@ -221,7 +221,7 @@ function appkey2sec($appkey) { // mobi_app 查表 // appkey 反查 -function appkey2mobi($appkey,$flip=false) { +function appkey2mobi($appkey, $flip=false) { if ($appkey == "") {return "";} $appkey2mobi = array("57263273bc6b67f6" => "android", // 安卓 客户端 "bca7e84c2d947ac6" => "android", // 安卓 客户端 登录专用 @@ -279,7 +279,7 @@ function check_appkey($appkey="1d8b6e7d45233436") { // 检查 mobi_app function check_mobi_app($mobi_app="iphone") { - $appkey = appkey2mobi($mobi_app,$flip=true); + $appkey = appkey2mobi($mobi_app, $flip=true); $appsec = appkey2sec($appkey); if ($appkey == "" || $appsec == "") { return array("", "", "", ""); diff --git a/utils/functions_cache.php b/utils/functions_cache.php index 563f347..83adabb 100644 --- a/utils/functions_cache.php +++ b/utils/functions_cache.php @@ -18,7 +18,7 @@ try { if (REDIS_ON) { include 'redis-class.php'; try { - $redisConn = new redisFunc(REDIS_HOST,REDIS_PORT,REDIS_PASS); + $redisConn = new redisFunc(REDIS_HOST, REDIS_PORT, REDIS_PASS); } catch(Exception $e) { echo 'redis连接失敗'; } @@ -68,7 +68,7 @@ function get_userinfo_fromsql() { $vnum = $cres -> fetch(); if (!$vnum) { $member_type = 0; //未登录 - return ["0","0","0","0"]; + return ["0", "0", "0", "0"]; } $uid = $vnum['uid']; $add_time = $vnum['add_time']; @@ -89,10 +89,10 @@ function get_cache() { global $cache_type; global $refresh_cache; if (REDIS_ON) { - $redisConn = new redisFunc(REDIS_HOST,REDIS_PORT,REDIS_PASS); - if ($redisConn->check(AREA.'-'.$member_type.'-'.$cache_type.'-'.CID.'-'.EP_ID)) { - @$cache = $redisConn->get(AREA.'-'.$member_type.'-'.$cache_type.'-'.CID.'-'.EP_ID); - @$expired_time = $redisConn->ttl(AREA.'-'.$member_type.'-'.$cache_type.'-'.CID.'-'.EP_ID)+time(); + $redisConn = new redisFunc(REDIS_HOST, REDIS_PORT, REDIS_PASS); + if ($redisConn -> check(AREA.'-'.$member_type.'-'.$cache_type.'-'.CID.'-'.EP_ID)) { + @$cache = $redisConn -> get(AREA.'-'.$member_type.'-'.$cache_type.'-'.CID.'-'.EP_ID); + @$expired_time = $redisConn -> ttl(AREA.'-'.$member_type.'-'.$cache_type.'-'.CID.'-'.EP_ID)+time(); } else { $cache = ""; } @@ -114,8 +114,8 @@ function get_cache() { $cache = str_replace("\r", "\\r", $cache); $cache = str_replace("\n", "\\n", $cache); if (QN != "" && ($cache_type == "app" || $cache_type == "appV2")) { - $cache = str_replace('"data":{"video_info":{"quality":','"data":{"video_info":{"quality":'.QN.',"quality_fuck":',$cache); - $cache = str_replace('"data":{"playurl":{"quality":','"data":{"playurl":{"quality":'.QN.',"quality_fuck":',$cache); + $cache = str_replace('"data":{"video_info":{"quality":', '"data":{"video_info":{"quality":'.QN.',"quality_fuck":', $cache); + $cache = str_replace('"data":{"playurl":{"quality":', '"data":{"playurl":{"quality":'.QN.',"quality_fuck":', $cache); } if ($cache != "") { if (time() <= (int)$expired_time) { @@ -204,17 +204,17 @@ function get_cache_season() { if (REDIS_ON) { $redisConn = new redisFunc(REDIS_HOST,REDIS_PORT,REDIS_PASS); if (EP_ID != "") { - if ($redisConn->check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ - @$cache = $redisConn->get($area.'-season-'.$cache_type.'-0-'.EP_ID); - @$expired_time = $redisConn->ttl($area.'-season-'.$cache_type.'-0-'.EP_ID)+time(); + if ($redisConn -> check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ + @$cache = $redisConn -> get($area.'-season-'.$cache_type.'-0-'.EP_ID); + @$expired_time = $redisConn -> ttl($area.'-season-'.$cache_type.'-0-'.EP_ID)+time(); } else { @$cache = ""; @$expired_time = time(); } } elseif (SS_ID != "") { - if ($redisConn->check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ - @$cache = $redisConn->get($area.'-season-'.$cache_type.'-'.SS_ID.'-0'); - @$expired_time = $redisConn->ttl($area.'-season-'.$cache_type.'-'.SS_ID.'-0')+time(); + if ($redisConn -> check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ + @$cache = $redisConn -> get($area.'-season-'.$cache_type.'-'.SS_ID.'-0'); + @$expired_time = $redisConn -> ttl($area.'-season-'.$cache_type.'-'.SS_ID.'-0')+time(); } else { @$cache = ""; @$expired_time = time(); @@ -223,17 +223,17 @@ function get_cache_season() { if (!$cache) { if ($area == "main") { if (EP_ID != "") { - if ($redisConn->check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ - @$cache = $redisConn->get($area.'-season-'.$cache_type.'-0-'.EP_ID); - @$expired_time = $redisConn->ttl($area.'-season-'.$cache_type.'-0-'.EP_ID)+time(); + if ($redisConn -> check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ + @$cache = $redisConn -> get($area.'-season-'.$cache_type.'-0-'.EP_ID); + @$expired_time = $redisConn -> ttl($area.'-season-'.$cache_type.'-0-'.EP_ID)+time(); } else { @$cache = ""; @$expired_time = time(); } } elseif (SS_ID != "") { - if ($redisConn->check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ - @$cache = $redisConn->get(AREA.'-season-'.$cache_type.'-'.SS_ID.'-0'); - @$expired_time = $redisConn->ttl(AREA.'-season-'.$cache_type.'-'.SS_ID.'-0')+time(); + if ($redisConn -> check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ + @$cache = $redisConn -> get(AREA.'-season-'.$cache_type.'-'.SS_ID.'-0'); + @$expired_time = $redisConn -> ttl(AREA.'-season-'.$cache_type.'-'.SS_ID.'-0')+time(); } else { @$cache = ""; @$expired_time = time(); @@ -528,7 +528,7 @@ function get_cache_blacklist() { $cres = $dbh -> query($sqlco); $vnum = $cres -> fetch(); if (!$vnum) { - return ["⑨","⑨"]; + return ["⑨", "⑨"]; } //$uid = $vnum['uid']; $expired_time = $vnum['expired_time']; @@ -536,7 +536,7 @@ function get_cache_blacklist() { $is_whitelist = $vnum['is_whitelist']; if (time() > (int)$expired_time) { $refresh_cache_status = 1; // 刷新缓存 - return ["⑨","⑨"]; + return ["⑨", "⑨"]; } return [$is_blacklist, $is_whitelist]; } @@ -586,7 +586,7 @@ function read_status($area){ } //写入此次解析状态 -function write_status($code,$area) { +function write_status($code, $area) { global $dbh; $result = $dbh -> query("SHOW TABLES LIKE 'status_code'"); $row = $result -> fetchAll(); diff --git a/utils/process.php b/utils/process.php index 3b44cd7..d955b52 100644 --- a/utils/process.php +++ b/utils/process.php @@ -4,7 +4,7 @@ if(!defined('SYSTEM')) {exit();} // 判断要转发的内容 $path = explode('/index.php', $_SERVER['PHP_SELF'])[0]; -$query = str_replace("&&", "",str_replace("/&", "", $_SERVER['QUERY_STRING'])); +$query = str_replace("&&", "", str_replace("/&", "", $_SERVER['QUERY_STRING'])); // 修复参数开头为 & 的问题 if (substr($query,0,1) == "&") { $query = substr($query,1); @@ -53,7 +53,7 @@ define('QN', @$_GET['qn']); define('BILIROAMING_VERSION', @$_SERVER['HTTP_X_FROM_BILIROAMING']); define('BILIROAMING_VERSION_CODE', @$_SERVER['HTTP_BUILD']); $baned = 0; -$th_paths = array("/intl/gateway/v2/app/search/type","/intl/gateway/v2/app/search/v2","/intl/gateway/v2/app/subtitle","/intl/gateway/web/v2/subtitle","/intl/gateway/v2/ogv/view/app/season","/intl/gateway/v2/ogv/view/app/season2","/intl/gateway/v2/ogv/playurl","/intl/gateway/v2/ogv/view/app/episode"); +$th_paths = array("/intl/gateway/v2/app/search/type", "/intl/gateway/v2/app/search/v2", "/intl/gateway/v2/app/subtitle", "/intl/gateway/web/v2/subtitle", "/intl/gateway/v2/ogv/view/app/season", "/intl/gateway/v2/ogv/view/app/season2", "/intl/gateway/v2/ogv/playurl", "/intl/gateway/v2/ogv/view/app/episode"); $get_area = @$_GET['area']; if (BILIROAMING_VERSION == '' && BILIROAMING_VERSION_CODE == '') { if (BILIROAMING == 1 && WEB_ON == 0 && $path!="") { // 仅限漫游用户,且未开放web脚本 diff --git a/utils/refresh_token_th.php b/utils/refresh_token_th.php index c2689ad..1c94b2c 100644 --- a/utils/refresh_token_th.php +++ b/utils/refresh_token_th.php @@ -31,7 +31,7 @@ if ($httpcode == "301") { // 转发到指定服务器 $url = CUSTOM_HOST_TH_TOKEN."/x/intl/passport-login/oauth2/refresh_token/index.php?".$PostData; if (IP_RESOLVE == 1) { - $output2 = get_webpage($url,$host,$ip); + $output2 = get_webpage($url, $host, $ip); } else { $output2 = get_webpage($url); } diff --git a/utils/replace.php b/utils/replace.php index 5360abe..82a1404 100644 --- a/utils/replace.php +++ b/utils/replace.php @@ -3,7 +3,7 @@ if(!defined('SYSTEM')) {exit();} // 替换内容 -$output = str_replace("\u0026","&",$output); +$output = str_replace("\u0026", "&", $output); switch ($type) { case 0: // 搜索 if ($cache_type != "web") { @@ -13,7 +13,7 @@ switch ($type) { case 1: // playurl break; case 2: // 东南亚APP season - $output = str_replace('"vip":0','"vip":1',$output); // 支持漫游 #320 + $output = str_replace('"vip":0', '"vip":1', $output); // 支持漫游 #320 if (AREA == "th") { include (ROOT_PATH."utils/fuck_sub.php"); // 添加中文字幕 } diff --git a/utils/replace_playurl.php b/utils/replace_playurl.php index 705f262..701c52b 100644 --- a/utils/replace_playurl.php +++ b/utils/replace_playurl.php @@ -85,7 +85,7 @@ function replace_playurl() { // 发送内容 $output3 = json_encode($array2); - $output3 = str_replace("\/","/",$output3); + $output3 = str_replace("\/", "/", $output3); exit($output3); } ?> diff --git a/x/v2/search/type/index.php b/x/v2/search/type/index.php index c1ef487..f124f43 100644 --- a/x/v2/search/type/index.php +++ b/x/v2/search/type/index.php @@ -11,7 +11,7 @@ include (ROOT_PATH."utils/functions.php"); // 处理用户传入参数 include (ROOT_PATH."utils/process.php"); // 设置host -$host = get_host($type,$cache_type); +$host = get_host($type, $cache_type); // 锁区、web接口、X-From-Biliroaming include (ROOT_PATH."utils/lock_area.php"); // 鉴权、替换access_key、获取缓存 @@ -26,7 +26,7 @@ $query = $add_query($type, $query, ""); // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); } diff --git a/x/web-interface/search/type/index.php b/x/web-interface/search/type/index.php index 2df1194..95ea6bc 100644 --- a/x/web-interface/search/type/index.php +++ b/x/web-interface/search/type/index.php @@ -11,7 +11,7 @@ include (ROOT_PATH."utils/functions.php"); // 处理用户传入参数 include (ROOT_PATH."utils/process.php"); // 设置host -$host = get_host($type,$cache_type); +$host = get_host($type, $cache_type); // 锁区、web接口、X-From-Biliroaming include (ROOT_PATH."utils/lock_area.php"); // 鉴权、替换access_key、获取缓存 @@ -24,7 +24,7 @@ if (IP_RESOLVE == 1) { // 转发到指定服务器 $url = $host.$path."?".$query; if (IP_RESOLVE == 1) { - $output = get_webpage($url,$host,$ip); + $output = get_webpage($url, $host, $ip); } else { $output = get_webpage($url); }