Refine code

pull/43/head
david082321 2 years ago
parent 96aafdecb6
commit afea6b94c2

@ -17,10 +17,7 @@ include (ROOT_PATH."utils/process.php");
$host = CUSTOM_HOST_TH_SUB; $host = CUSTOM_HOST_TH_SUB;
// 锁区、web接口、X-From-Biliroaming // 锁区、web接口、X-From-Biliroaming
//// (无) //// (无)
// 鉴权、替换access_key、获取缓存 // 获取缓存
if ($baned == 1) {
block();
}
if (SAVE_CACHE == 1) { if (SAVE_CACHE == 1) {
get_cache_subtitle(); // 获取缓存 get_cache_subtitle(); // 获取缓存
} }

@ -14,10 +14,6 @@ include (ROOT_PATH."utils/process.php");
$host = CUSTOM_HOST_TH; $host = CUSTOM_HOST_TH;
// 锁区、web接口、X-From-Biliroaming // 锁区、web接口、X-From-Biliroaming
include (ROOT_PATH."utils/lock_area.php"); include (ROOT_PATH."utils/lock_area.php");
// 鉴权、替换access_key、获取缓存
if ($baned == 1) {
block();
}
// 指定ip回源 // 指定ip回源
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
$host = $hosts[array_rand($hosts)]; $host = $hosts[array_rand($hosts)];

@ -17,10 +17,7 @@ include (ROOT_PATH."utils/process.php");
$host = CUSTOM_HOST_TH; $host = CUSTOM_HOST_TH;
// 锁区、web接口、X-From-Biliroaming // 锁区、web接口、X-From-Biliroaming
include (ROOT_PATH."utils/lock_area.php"); include (ROOT_PATH."utils/lock_area.php");
// 鉴权、替换access_key、获取缓存 // 获取缓存
if ($baned == 1) {
block();
}
if (SAVE_CACHE == 1) { if (SAVE_CACHE == 1) {
get_cache_season(); // 获取缓存 get_cache_season(); // 获取缓存
} }

@ -17,10 +17,7 @@ include (ROOT_PATH."utils/process.php");
$host = CUSTOM_HOST_TH; $host = CUSTOM_HOST_TH;
// 锁区、web接口、X-From-Biliroaming // 锁区、web接口、X-From-Biliroaming
include (ROOT_PATH."utils/lock_area.php"); include (ROOT_PATH."utils/lock_area.php");
// 鉴权、替换access_key、获取缓存 // 获取缓存
if ($baned == 1) {
block();
}
if (SAVE_CACHE == 1) { if (SAVE_CACHE == 1) {
get_cache_season(); // 获取缓存 get_cache_season(); // 获取缓存
} }

@ -17,10 +17,7 @@ include (ROOT_PATH."utils/process.php");
$host = CUSTOM_HOST_TH_WEBSUB; $host = CUSTOM_HOST_TH_WEBSUB;
// 锁区、web接口、X-From-Biliroaming // 锁区、web接口、X-From-Biliroaming
//// (无) //// (无)
// 鉴权、替换access_key、获取缓存 // 获取缓存
if ($baned == 1) {
block();
}
if (SAVE_CACHE == 1) { if (SAVE_CACHE == 1) {
get_cache_subtitle(); // 获取缓存 get_cache_subtitle(); // 获取缓存
} }

@ -86,6 +86,7 @@ if (ACCESS_KEY != "") { // access_key 存在
} }
} }
$is_baned = false; $is_baned = false;
$baned = 0;
switch (BLOCK_TYPE) { switch (BLOCK_TYPE) {
case "blacklist": // 在线黑名单 case "blacklist": // 在线黑名单
if ($is_blacklist) { if ($is_blacklist) {

@ -576,7 +576,7 @@ function read_status($area){
$sqlco = "SELECT `code` FROM `status_code` WHERE `area` = '".$area."'"; $sqlco = "SELECT `code` FROM `status_code` WHERE `area` = '".$area."'";
$result = $dbh -> query($sqlco); $result = $dbh -> query($sqlco);
$code = $result -> fetch(); $code = $result -> fetch();
if ($code == false) { if (!$code) {
return 0; return 0;
} }
return $code['code']; return $code['code'];
@ -593,7 +593,6 @@ function write_status($code, $area) {
//判断表是否存在 //判断表是否存在
if ( count($row) == '1' ) { if ( count($row) == '1' ) {
$sql = "UPDATE `status_code` SET `time` = '".time()."', `code` = '".$code."' WHERE `area` = '".$area."';"; $sql = "UPDATE `status_code` SET `time` = '".time()."', `code` = '".$code."' WHERE `area` = '".$area."';";
$dbh -> exec($sql);
} else { } else {
$sql = "CREATE TABLE status_code ( $sql = "CREATE TABLE status_code (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
@ -609,8 +608,8 @@ function write_status($code, $area) {
$sql = "INSERT INTO `status_code` (`area`,`code`,`time`) VALUES ('tw','".$code."','".time()."')"; $sql = "INSERT INTO `status_code` (`area`,`code`,`time`) VALUES ('tw','".$code."','".time()."')";
$dbh -> exec($sql); $dbh -> exec($sql);
$sql = "INSERT INTO `status_code` (`area`,`code`,`time`) VALUES ('th','".$code."','".time()."')"; $sql = "INSERT INTO `status_code` (`area`,`code`,`time`) VALUES ('th','".$code."','".time()."')";
$dbh -> exec($sql);
} }
$dbh -> exec($sql);
} }
// 写入日志 // 写入日志

@ -52,7 +52,6 @@ define('SS_ID', @$_GET['season_id']);
define('QN', @$_GET['qn']); 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;
$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 == '') {

@ -94,5 +94,6 @@
} }
return $ttl; return $ttl;
} }
}; }
?> ?>

@ -2,7 +2,7 @@
// 防止外部破解 // 防止外部破解
if(!defined('SYSTEM')) {exit();} // 防止外部破解,此行勿改 if(!defined('SYSTEM')) {exit();} // 防止外部破解,此行勿改
define('VERSION', '4.5.1'); const VERSION = '4.5.1';
// 加上json的Header // 加上json的Header
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: application/json; charset=utf-8');
// 加上web的Header // 加上web的Header

Loading…
Cancel
Save