修改对泰区proxy分流判断的相关代码,以及一些微小的改动 Author: @AisukaYuki

修改对泰区proxy分流判断的相关代码,以及一些微小的改动
Author: @AisukaYuki
pull/26/head
AisukaYuki 3 years ago committed by GitHub
parent 6fc82966b2
commit f8e84757f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,11 +22,7 @@ function get_webpage($url,$host="",$ip="") {
curl_setopt($ch, CURLOPT_PROXY, PROXY_IP_TH); curl_setopt($ch, CURLOPT_PROXY, PROXY_IP_TH);
break; break;
default: default:
if ($host = CUSTOM_HOST_TH_TOKEN || $host = CUSTOM_HOST_TH_SEARCH || $host = CUSTOM_HOST_TH || $host = CUSTOM_HOST_TH_SUB) { curl_setopt($ch, CURLOPT_PROXY, PROXY_IP);
curl_setopt($ch, CURLOPT_PROXY, PROXY_IP_TH);
} else {
curl_setopt($ch, CURLOPT_PROXY, PROXY_IP);
}
} }
} }
if (IP_RESOLVE == 1) { // 指定ip回源 if (IP_RESOLVE == 1) { // 指定ip回源

@ -269,7 +269,6 @@ function write_cache_season() {
if ($refresh_cache_season_main == 1) { if ($refresh_cache_season_main == 1) {
$sql = "UPDATE `cache` SET `expired_time` = '".$ts."', `cache` = '".$output."' WHERE `area` = '".$area."' AND `cache_type` = 'season_".$cache_type."' AND `cid` = '".$ss_id."' AND `ep_id` = '".$ep_id."';"; $sql = "UPDATE `cache` SET `expired_time` = '".$ts."', `cache` = '".$output."' WHERE `area` = '".$area."' AND `cache_type` = 'season_".$cache_type."' AND `cid` = '".$ss_id."' AND `ep_id` = '".$ep_id."';";
} }
$dbh -> exec($sql);
} else if($code !== ""){ } else if($code !== ""){
// 缓存到自身 AREA 里面 // 缓存到自身 AREA 里面
$sql = "INSERT INTO `cache` (`expired_time`,`area`,`type`,`cache_type`,`cid`,`ep_id`,`cache`) VALUES ('".$ts."','".AREA."','0','season_".$cache_type."','".$ss_id."','".$ep_id."','".$output."')"; $sql = "INSERT INTO `cache` (`expired_time`,`area`,`type`,`cache_type`,`cid`,`ep_id`,`cache`) VALUES ('".$ts."','".AREA."','0','season_".$cache_type."','".$ss_id."','".$ep_id."','".$output."')";

@ -17,13 +17,20 @@ if (BILIROAMING_VERSION == '') {
$baned = 10; $baned = 10;
block($baned); block($baned);
} }
if (@$_GET['area'] == '' || @$_GET['area'] == 'false') { //web脚本 if (@$_GET['area'] == '' || @$_GET['area'] == 'false') { //web脚本,兼容泰区无area情况
define('AREA', 'noarea'); if ($path == "/intl/gateway/v2/app/search/type" || $path == "/intl/gateway/v2/app/subtitle" || $path == "/intl/gateway/v2/ogv/view/app/season") {
define('AREA', 'th');
} else {
define('AREA', 'noarea');
} else { } else {
define('AREA', @$_GET['area']); define('AREA', @$_GET['area']);
} }
} else if (@$_GET['area'] == '') { //适配老漫游版本 } else if (@$_GET['area'] == '') { //适配老漫游版本兼容泰区无area情况
define('AREA', 'oldversion'); if ($path == "/intl/gateway/v2/app/search/type" || $path == "/intl/gateway/v2/app/subtitle" || $path == "/intl/gateway/v2/ogv/view/app/season") {
define('AREA', 'th');
} else {
define('AREA', 'oldversion');
}
} else { } else {
define('AREA', @$_GET['area']); define('AREA', @$_GET['area']);
} }
@ -84,4 +91,4 @@ function block($baned){
http_response_code(404); http_response_code(404);
exit('{"code":-418,"message":"'.$reason.'"}'); exit('{"code":-418,"message":"'.$reason.'"}');
} }
?> ?>

@ -24,7 +24,7 @@ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POST, true);
if (PROXY_ON == 1) { if (PROXY_ON == 1) {
curl_setopt($ch, CURLOPT_PROXYTYPE, PROXY_TYPE); curl_setopt($ch, CURLOPT_PROXYTYPE, PROXY_TYPE);
curl_setopt($ch, CURLOPT_PROXY, PROXY_IP); curl_setopt($ch, CURLOPT_PROXY, PROXY_IP_TH);
} }
if (IP_RESOLVE == 1) { if (IP_RESOLVE == 1) {
curl_setopt($ch, CURLOPT_RESOLVE, [$host.":443:".$ip]); curl_setopt($ch, CURLOPT_RESOLVE, [$host.":443:".$ip]);

Loading…
Cancel
Save