Refine code

pull/39/head
david082321 2 years ago committed by GitHub
parent 22e05c2c32
commit c1bed9ed46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,7 +3,7 @@
define('SYSTEM', TRUE); 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 本地白名單, 不是填写前面几个就是不封锁 define('BLOCK_TYPE', 'blacklist'); // 封锁类型blacklist 在线黑名单, whitelist 在线白名单, local_blacklist 本地黑名单, local_whitelist 本地白名單, 不是填写前面几个就是不封锁

@ -17,7 +17,7 @@ include (ROOT_PATH."utils/process.php");
if ((CID != "" || EP_ID != "") && WEB_ON == 1) { if ((CID != "" || EP_ID != "") && WEB_ON == 1) {
// Web接口 // Web接口
$path = "/pgc/player/web/playurl"; $path = "/pgc/player/web/playurl";
$host = get_host($type,$cache_type); $host = get_host($type, $cache_type);
} else { } else {
// 欢迎语 // 欢迎语
header('Content-Type: text/html; charset=utf-8'); header('Content-Type: text/html; charset=utf-8');
@ -46,7 +46,7 @@ if (IP_RESOLVE == 1) {
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

@ -26,7 +26,7 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

@ -26,7 +26,7 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

@ -34,7 +34,7 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

@ -35,12 +35,12 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }
// 412提醒 // 412提醒
check_412($output,$get_area); check_412($output, $get_area);
// 替换内容 // 替换内容
include (ROOT_PATH."utils/replace.php"); include (ROOT_PATH."utils/replace.php");
// 返回内容给用户 // 返回内容给用户

@ -28,7 +28,7 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

@ -34,7 +34,7 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

@ -34,7 +34,7 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

@ -32,7 +32,7 @@ if (IP_RESOLVE == 1) {
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

@ -14,7 +14,7 @@ if (SAVE_CACHE == 1) {
// 处理用户传入参数 // 处理用户传入参数
include (ROOT_PATH."utils/process.php"); include (ROOT_PATH."utils/process.php");
// 设置host // 设置host
$host = get_host($type,$cache_type); $host = get_host($type, $cache_type);
// 锁区、web接口、X-From-Biliroaming // 锁区、web接口、X-From-Biliroaming
include (ROOT_PATH."utils/lock_area.php"); include (ROOT_PATH."utils/lock_area.php");
// 鉴权、替换access_key、获取缓存 // 鉴权、替换access_key、获取缓存
@ -35,12 +35,12 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }
// 412提醒 // 412提醒
check_412($output,$get_area); check_412($output, $get_area);
// 替换内容 // 替换内容
include (ROOT_PATH."utils/replace.php"); include (ROOT_PATH."utils/replace.php");
// 返回内容给用户 // 返回内容给用户

@ -14,7 +14,7 @@ if (SAVE_CACHE == 1) {
// 处理用户传入参数 // 处理用户传入参数
include (ROOT_PATH."utils/process.php"); include (ROOT_PATH."utils/process.php");
// 设置host // 设置host
$host = get_host($type,$cache_type); $host = get_host($type, $cache_type);
// 锁区、web接口、X-From-Biliroaming // 锁区、web接口、X-From-Biliroaming
include (ROOT_PATH."utils/lock_area.php"); include (ROOT_PATH."utils/lock_area.php");
// 鉴权、替换access_key、获取缓存 // 鉴权、替换access_key、获取缓存
@ -35,12 +35,12 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }
// 412提醒 // 412提醒
check_412($output,$get_area); check_412($output, $get_area);
// 替换内容 // 替换内容
include (ROOT_PATH."utils/replace.php"); include (ROOT_PATH."utils/replace.php");
// 返回内容给用户 // 返回内容给用户

@ -14,7 +14,7 @@ if (SAVE_CACHE == 1) {
// 处理用户传入参数 // 处理用户传入参数
include (ROOT_PATH."utils/process.php"); include (ROOT_PATH."utils/process.php");
// 设置host // 设置host
$host = get_host($type,$cache_type); $host = get_host($type, $cache_type);
// 锁区、web接口、X-From-Biliroaming // 锁区、web接口、X-From-Biliroaming
include (ROOT_PATH."utils/lock_area.php"); include (ROOT_PATH."utils/lock_area.php");
// 鉴权、替换access_key、获取缓存 // 鉴权、替换access_key、获取缓存
@ -32,7 +32,7 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

@ -129,7 +129,7 @@ if (ACCESS_KEY != "") { // access_key 存在
write_log(); write_log();
} }
// 开始ban // 开始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 ($is_baned) {
if (in_array(REPLACE_TYPE, $support_replace_type)) { if (in_array(REPLACE_TYPE, $support_replace_type)) {
include (ROOT_PATH."utils/replace_playurl.php"); include (ROOT_PATH."utils/replace_playurl.php");

@ -34,8 +34,8 @@
@$total = $array['data']['total']; @$total = $array['data']['total'];
@$pages = $array['data']['pages']; @$pages = $array['data']['pages'];
@$items_old = $array['data']['items']; @$items_old = $array['data']['items'];
$items_new= trim(json_encode($items_old, 320),'[]'); $items_new= trim(json_encode($items_old, 320), '[]');
$items = str_replace('["追番","已追番"]','{"0":"追番","1":"已追番"}',$items_new); $items = str_replace('["追番","已追番"]', '{"0":"追番","1":"已追番"}', $items_new);
} else { } else {
$trackid = ""; $trackid = "";
$exp_str = ""; $exp_str = "";

@ -71,14 +71,14 @@
} }
$sub_count = count($sub_arr); $sub_count = count($sub_arr);
$add_arr = array( $add_arr = array(
"id"=>1, "id" => 1,
"key"=>$key, "key" => $key,
"title"=>"[非官方]".$lang."(".SUBTITLE_TEAM_NAME.")", "title" => "[非官方]".$lang."(".SUBTITLE_TEAM_NAME.")",
"url"=>"https://".$url, "url" => "https://".$url,
"is_machine"=>false "is_machine" => false
); );
array_unshift($sub_arr,$add_arr); //这个会放在前面 array_unshift($sub_arr, $add_arr); //这个会放在前面
//array_push($sub_arr,$add_arr); //这个会放在后面 //array_push($sub_arr, $add_arr); //这个会放在后面
if ($ss_type == "result") { if ($ss_type == "result") {
$array['result']['modules'][0]['data']['episodes'][$ep]['subtitles'] = $sub_arr; $array['result']['modules'][0]['data']['episodes'][$ep]['subtitles'] = $sub_arr;
} else { } else {

@ -3,7 +3,7 @@
if(!defined('SYSTEM')) {exit();} if(!defined('SYSTEM')) {exit();}
$member_type = 0; // 判断用户状态 $member_type = 0; // 判断用户状态
function get_webpage($url,$host="",$ip="") { function get_webpage($url, $host="", $ip="") {
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
if (PROXY_ON == 1) { // 指定代理 if (PROXY_ON == 1) { // 指定代理
@ -55,7 +55,7 @@ function get_blacklist($uid) {
return $output; return $output;
} }
function get_host($type,$cache_type) { function get_host($type, $cache_type) {
switch ($type) { switch ($type) {
case 1: // playurl case 1: // playurl
switch (AREA) { switch (AREA) {
@ -154,7 +154,7 @@ function get_userinfo() {
} }
// 412 提醒 // 412 提醒
function check_412($output,$get_area) { function check_412($output, $get_area) {
if (TG_NOTIFY == 1) { if (TG_NOTIFY == 1) {
$status = json_decode($output, true); $status = json_decode($output, true);
$msg = ""; $msg = "";
@ -167,12 +167,12 @@ function check_412($output,$get_area) {
if ($latest_code != $status['code']) { if ($latest_code != $status['code']) {
if ($status['code'] == -412) { if ($status['code'] == -412) {
$msg = '破服务器412啦地区:' . $get_area; $msg = '破服务器412啦地区:' . $get_area;
write_status($status['code'],$get_area); write_status($status['code'], $get_area);
} else { } else {
if ($latest_code == -412) { if ($latest_code == -412) {
$msg = '破服务器恢复啦,地区:' . $get_area; $msg = '破服务器恢复啦,地区:' . $get_area;
} }
write_status(0,$get_area); write_status(0, $get_area);
} }
} }
} }
@ -221,7 +221,7 @@ function appkey2sec($appkey) {
// mobi_app 查表 // mobi_app 查表
// appkey 反查 // appkey 反查
function appkey2mobi($appkey,$flip=false) { function appkey2mobi($appkey, $flip=false) {
if ($appkey == "") {return "";} if ($appkey == "") {return "";}
$appkey2mobi = array("57263273bc6b67f6" => "android", // 安卓 客户端 $appkey2mobi = array("57263273bc6b67f6" => "android", // 安卓 客户端
"bca7e84c2d947ac6" => "android", // 安卓 客户端 登录专用 "bca7e84c2d947ac6" => "android", // 安卓 客户端 登录专用
@ -279,7 +279,7 @@ function check_appkey($appkey="1d8b6e7d45233436") {
// 检查 mobi_app // 检查 mobi_app
function check_mobi_app($mobi_app="iphone") { function check_mobi_app($mobi_app="iphone") {
$appkey = appkey2mobi($mobi_app,$flip=true); $appkey = appkey2mobi($mobi_app, $flip=true);
$appsec = appkey2sec($appkey); $appsec = appkey2sec($appkey);
if ($appkey == "" || $appsec == "") { if ($appkey == "" || $appsec == "") {
return array("", "", "", ""); return array("", "", "", "");

@ -18,7 +18,7 @@ try {
if (REDIS_ON) { if (REDIS_ON) {
include 'redis-class.php'; include 'redis-class.php';
try { try {
$redisConn = new redisFunc(REDIS_HOST,REDIS_PORT,REDIS_PASS); $redisConn = new redisFunc(REDIS_HOST, REDIS_PORT, REDIS_PASS);
} catch(Exception $e) { } catch(Exception $e) {
echo 'redis连接失敗'; echo 'redis连接失敗';
} }
@ -68,7 +68,7 @@ function get_userinfo_fromsql() {
$vnum = $cres -> fetch(); $vnum = $cres -> fetch();
if (!$vnum) { if (!$vnum) {
$member_type = 0; //未登录 $member_type = 0; //未登录
return ["0","0","0","0"]; return ["0", "0", "0", "0"];
} }
$uid = $vnum['uid']; $uid = $vnum['uid'];
$add_time = $vnum['add_time']; $add_time = $vnum['add_time'];
@ -89,10 +89,10 @@ function get_cache() {
global $cache_type; global $cache_type;
global $refresh_cache; global $refresh_cache;
if (REDIS_ON) { if (REDIS_ON) {
$redisConn = new redisFunc(REDIS_HOST,REDIS_PORT,REDIS_PASS); $redisConn = new redisFunc(REDIS_HOST, REDIS_PORT, REDIS_PASS);
if ($redisConn->check(AREA.'-'.$member_type.'-'.$cache_type.'-'.CID.'-'.EP_ID)) { if ($redisConn -> check(AREA.'-'.$member_type.'-'.$cache_type.'-'.CID.'-'.EP_ID)) {
@$cache = $redisConn->get(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(); @$expired_time = $redisConn -> ttl(AREA.'-'.$member_type.'-'.$cache_type.'-'.CID.'-'.EP_ID)+time();
} else { } else {
$cache = ""; $cache = "";
} }
@ -114,8 +114,8 @@ function get_cache() {
$cache = str_replace("\r", "\\r", $cache); $cache = str_replace("\r", "\\r", $cache);
$cache = str_replace("\n", "\\n", $cache); $cache = str_replace("\n", "\\n", $cache);
if (QN != "" && ($cache_type == "app" || $cache_type == "appV2")) { 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":{"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":{"playurl":{"quality":', '"data":{"playurl":{"quality":'.QN.',"quality_fuck":', $cache);
} }
if ($cache != "") { if ($cache != "") {
if (time() <= (int)$expired_time) { if (time() <= (int)$expired_time) {
@ -204,17 +204,17 @@ function get_cache_season() {
if (REDIS_ON) { if (REDIS_ON) {
$redisConn = new redisFunc(REDIS_HOST,REDIS_PORT,REDIS_PASS); $redisConn = new redisFunc(REDIS_HOST,REDIS_PORT,REDIS_PASS);
if (EP_ID != "") { if (EP_ID != "") {
if ($redisConn->check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ if ($redisConn -> check($area.'-season-'.$cache_type.'-0-'.EP_ID)){
@$cache = $redisConn->get($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(); @$expired_time = $redisConn -> ttl($area.'-season-'.$cache_type.'-0-'.EP_ID)+time();
} else { } else {
@$cache = ""; @$cache = "";
@$expired_time = time(); @$expired_time = time();
} }
} elseif (SS_ID != "") { } elseif (SS_ID != "") {
if ($redisConn->check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ if ($redisConn -> check($area.'-season-'.$cache_type.'-0-'.EP_ID)){
@$cache = $redisConn->get($area.'-season-'.$cache_type.'-'.SS_ID.'-0'); @$cache = $redisConn -> get($area.'-season-'.$cache_type.'-'.SS_ID.'-0');
@$expired_time = $redisConn->ttl($area.'-season-'.$cache_type.'-'.SS_ID.'-0')+time(); @$expired_time = $redisConn -> ttl($area.'-season-'.$cache_type.'-'.SS_ID.'-0')+time();
} else { } else {
@$cache = ""; @$cache = "";
@$expired_time = time(); @$expired_time = time();
@ -223,17 +223,17 @@ function get_cache_season() {
if (!$cache) { if (!$cache) {
if ($area == "main") { if ($area == "main") {
if (EP_ID != "") { if (EP_ID != "") {
if ($redisConn->check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ if ($redisConn -> check($area.'-season-'.$cache_type.'-0-'.EP_ID)){
@$cache = $redisConn->get($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(); @$expired_time = $redisConn -> ttl($area.'-season-'.$cache_type.'-0-'.EP_ID)+time();
} else { } else {
@$cache = ""; @$cache = "";
@$expired_time = time(); @$expired_time = time();
} }
} elseif (SS_ID != "") { } elseif (SS_ID != "") {
if ($redisConn->check($area.'-season-'.$cache_type.'-0-'.EP_ID)){ if ($redisConn -> check($area.'-season-'.$cache_type.'-0-'.EP_ID)){
@$cache = $redisConn->get(AREA.'-season-'.$cache_type.'-'.SS_ID.'-0'); @$cache = $redisConn -> get(AREA.'-season-'.$cache_type.'-'.SS_ID.'-0');
@$expired_time = $redisConn->ttl(AREA.'-season-'.$cache_type.'-'.SS_ID.'-0')+time(); @$expired_time = $redisConn -> ttl(AREA.'-season-'.$cache_type.'-'.SS_ID.'-0')+time();
} else { } else {
@$cache = ""; @$cache = "";
@$expired_time = time(); @$expired_time = time();
@ -528,7 +528,7 @@ function get_cache_blacklist() {
$cres = $dbh -> query($sqlco); $cres = $dbh -> query($sqlco);
$vnum = $cres -> fetch(); $vnum = $cres -> fetch();
if (!$vnum) { if (!$vnum) {
return ["⑨","⑨"]; return ["⑨", "⑨"];
} }
//$uid = $vnum['uid']; //$uid = $vnum['uid'];
$expired_time = $vnum['expired_time']; $expired_time = $vnum['expired_time'];
@ -536,7 +536,7 @@ function get_cache_blacklist() {
$is_whitelist = $vnum['is_whitelist']; $is_whitelist = $vnum['is_whitelist'];
if (time() > (int)$expired_time) { if (time() > (int)$expired_time) {
$refresh_cache_status = 1; // 刷新缓存 $refresh_cache_status = 1; // 刷新缓存
return ["⑨","⑨"]; return ["⑨", "⑨"];
} }
return [$is_blacklist, $is_whitelist]; 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; global $dbh;
$result = $dbh -> query("SHOW TABLES LIKE 'status_code'"); $result = $dbh -> query("SHOW TABLES LIKE 'status_code'");
$row = $result -> fetchAll(); $row = $result -> fetchAll();

@ -4,7 +4,7 @@ if(!defined('SYSTEM')) {exit();}
// 判断要转发的内容 // 判断要转发的内容
$path = explode('/index.php', $_SERVER['PHP_SELF'])[0]; $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) == "&") { if (substr($query,0,1) == "&") {
$query = substr($query,1); $query = substr($query,1);
@ -53,7 +53,7 @@ define('QN', @$_GET['qn']);
define('BILIROAMING_VERSION', @$_SERVER['HTTP_X_FROM_BILIROAMING']); define('BILIROAMING_VERSION', @$_SERVER['HTTP_X_FROM_BILIROAMING']);
define('BILIROAMING_VERSION_CODE', @$_SERVER['HTTP_BUILD']); define('BILIROAMING_VERSION_CODE', @$_SERVER['HTTP_BUILD']);
$baned = 0; $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']; $get_area = @$_GET['area'];
if (BILIROAMING_VERSION == '' && BILIROAMING_VERSION_CODE == '') { if (BILIROAMING_VERSION == '' && BILIROAMING_VERSION_CODE == '') {
if (BILIROAMING == 1 && WEB_ON == 0 && $path!="") { // 仅限漫游用户且未开放web脚本 if (BILIROAMING == 1 && WEB_ON == 0 && $path!="") { // 仅限漫游用户且未开放web脚本

@ -31,7 +31,7 @@ if ($httpcode == "301") {
// 转发到指定服务器 // 转发到指定服务器
$url = CUSTOM_HOST_TH_TOKEN."/x/intl/passport-login/oauth2/refresh_token/index.php?".$PostData; $url = CUSTOM_HOST_TH_TOKEN."/x/intl/passport-login/oauth2/refresh_token/index.php?".$PostData;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output2 = get_webpage($url,$host,$ip); $output2 = get_webpage($url, $host, $ip);
} else { } else {
$output2 = get_webpage($url); $output2 = get_webpage($url);
} }

@ -3,7 +3,7 @@
if(!defined('SYSTEM')) {exit();} if(!defined('SYSTEM')) {exit();}
// 替换内容 // 替换内容
$output = str_replace("\u0026","&",$output); $output = str_replace("\u0026", "&", $output);
switch ($type) { switch ($type) {
case 0: // 搜索 case 0: // 搜索
if ($cache_type != "web") { if ($cache_type != "web") {
@ -13,7 +13,7 @@ switch ($type) {
case 1: // playurl case 1: // playurl
break; break;
case 2: // 东南亚APP season 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") { if (AREA == "th") {
include (ROOT_PATH."utils/fuck_sub.php"); // 添加中文字幕 include (ROOT_PATH."utils/fuck_sub.php"); // 添加中文字幕
} }

@ -85,7 +85,7 @@ function replace_playurl() {
// 发送内容 // 发送内容
$output3 = json_encode($array2); $output3 = json_encode($array2);
$output3 = str_replace("\/","/",$output3); $output3 = str_replace("\/", "/", $output3);
exit($output3); exit($output3);
} }
?> ?>

@ -11,7 +11,7 @@ include (ROOT_PATH."utils/functions.php");
// 处理用户传入参数 // 处理用户传入参数
include (ROOT_PATH."utils/process.php"); include (ROOT_PATH."utils/process.php");
// 设置host // 设置host
$host = get_host($type,$cache_type); $host = get_host($type, $cache_type);
// 锁区、web接口、X-From-Biliroaming // 锁区、web接口、X-From-Biliroaming
include (ROOT_PATH."utils/lock_area.php"); include (ROOT_PATH."utils/lock_area.php");
// 鉴权、替换access_key、获取缓存 // 鉴权、替换access_key、获取缓存
@ -26,7 +26,7 @@ $query = $add_query($type, $query, "");
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

@ -11,7 +11,7 @@ include (ROOT_PATH."utils/functions.php");
// 处理用户传入参数 // 处理用户传入参数
include (ROOT_PATH."utils/process.php"); include (ROOT_PATH."utils/process.php");
// 设置host // 设置host
$host = get_host($type,$cache_type); $host = get_host($type, $cache_type);
// 锁区、web接口、X-From-Biliroaming // 锁区、web接口、X-From-Biliroaming
include (ROOT_PATH."utils/lock_area.php"); include (ROOT_PATH."utils/lock_area.php");
// 鉴权、替换access_key、获取缓存 // 鉴权、替换access_key、获取缓存
@ -24,7 +24,7 @@ if (IP_RESOLVE == 1) {
// 转发到指定服务器 // 转发到指定服务器
$url = $host.$path."?".$query; $url = $host.$path."?".$query;
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$output = get_webpage($url,$host,$ip); $output = get_webpage($url, $host, $ip);
} else { } else {
$output = get_webpage($url); $output = get_webpage($url);
} }

Loading…
Cancel
Save