Merge branch 'david082321:main' into main

pull/14/head
AisukaYuki 3 years ago
commit 312ce33080

@ -6,7 +6,9 @@
## 下载:
* [下载(GitHub) v3.0.0](https://github.com/david082321/BiliRoaming-PHP-Server/raw/main/Server_v3.0.0.zip)
* [下载最新版](https://github.com/david082321/BiliRoaming-PHP-Server/releases/latest)
* [下载历史版本](https://github.com/david082321/BiliRoaming-PHP-Server/releases)
* 重要由于网页脚本的更新为作缓存区分v3.0.0 更新了数据库字段。从 1.x 或 2.x 升级的用户,请务必更新数据库。
@ -123,14 +125,16 @@
├─cache.sql (导入MySQL用的)[仅缓存使用]
├─config.php (用户设置)
├─config.php (设置本程序各种参数) <──参数设置在这里
├─index.php (接受上面index.php) <──主要入口在这里
├─log.php (缓存用户)[仅缓存使用]
├─process.php (处理用户传入参数)
├─replace.php (替换视频)
├─sign.php (重签名)[未公开源码]
└─resign.php (替换access_key)[未公开源码]
└─resign.php (替换访问密钥)[未公开源码]

Binary file not shown.

@ -1,4 +1,8 @@
<?php
// 防止外部破解
if(!defined('SYSTEM')) {exit(BLOCK_RETURN);} // 防止外部破解,此行勿改
// 封锁
define('BLOCK_TYPE','blacklist'); // 封锁类型blacklist 黑名单, whitelist 本地白名单, 不是填写前面两个就是不封锁
define('REPLACE_TYPE', 'tom'); // 是否替换视频(仅黑/白名单时生效)。hlw 葫芦娃, tom 猫和老鼠, xyy 喜羊羊, all 随机
@ -67,46 +71,11 @@ $ips=array('172.0.0.1','192.168.0.1','1.2.3.4');
$hosts=array('workers.dev','workers.dev');
// 其他
define('WELCOME', 'Success!'); //首页欢迎语
define('WELCOME', "Success!<br>Power by BiliRoaming-PHP-Server. Ver".VERSION); //首页欢迎语
define('BLOCK_RETURN', '{"code":-10403,"message":"抱歉您已被封锁"}'); //封锁返回内容
// 参数,不懂就别改
// 这个参数,不懂就别改
define('APPKEY', '1d8b6e7d45233436');
define('APPSEC', '560c52ccd288fed045859ed18bffd973');
define('ACCESS_KEY', @$_GET['access_key']);
define('CID', @$_GET['cid']);
define('EP_ID', @$_GET['ep_id']);
define('SS_ID', @$_GET['season_id']);
define('BILIROAMING_VERSION', @$_SERVER['HTTP_X_FROM_BILIROAMING']);
if (BILIROAMING_VERSION == '') {
if (BILIROAMING == 1 && WEB_ON == 0) { //仅限漫游用户且未开放web脚本
exit(BLOCK_RETURN);
}else if (@$_GET['area'] == '' || @$_GET['area'] == 'false') { //web脚本
define('AREA', 'noarea');
}
}else if (@$_GET['area'] == '') { //适配老漫游版本
define('AREA', 'oldversion');
}else{
define('AREA', @$_GET['area']);
}
if (@$_GET['ts'] == '') {
define('TS', time());
}else{
define('TS', @$_GET['ts']);
}
$baned = 0;
if (in_array(EP_ID, $epid_list) && BAN_EP == 1) {
$baned = 1;
}
if (in_array(CID, $cid_list) && BAN_CID == 1) {
$baned = 1;
}
if (in_array(AREA, $BAN_SERVER_AREA)) {
$baned = 1;
exit(BLOCK_RETURN);
}
// 防止外部破解
if(!defined('SYSTEM')) {
exit(BLOCK_RETURN);
}
?>

@ -1,9 +1,11 @@
<?php
// 防止外部破解
define('SYSTEM', TRUE);
define('VERSION', '3.0.0');
define('VERSION', '3.0.3');
// 加载配置
include ("config.php");
// 处理用户传入参数
include ("process.php");
// 加上json的Header
header('Content-Type: application/json; charset=utf-8');
// 加上web的Header
@ -21,12 +23,16 @@ $path = explode('/index.php', $_SERVER['PHP_SELF'])[0];
// 判断接口区分app和web缓存
$cache_type = 'app';//默认类型app
if ($path == "/pgc/player/web/playurl") {
$cache_type = 'web';
$cache_type = 'web';
}
$query = $_SERVER['QUERY_STRING'];
if ($path == "/intl/gateway/v2/ogv/playurl" || $path == "/intl/gateway/v2/ogv/view/app/season") {
$query = str_replace("/&","",$query);
if ($path == "/intl/gateway/v2/ogv/playurl") {
$host = CUSTOM_HOST_TH;
} elseif ($path == "/intl/gateway/v2/ogv/view/app/season") {
$host = CUSTOM_HOST_TH;
$query = "appkey=7d089525d3611b1c&autoplay=0&build=1052002&c_locale=&channel=master&lang=&locale=zh_SG&mobi_app=bstar_a&platform=android&s_locale=zh_SG&season_id=".SS_ID."&sim_code=&spmid=&ts=".TS;
} elseif ($path == "/intl/gateway/v2/app/search/type" || $path == "/intl/gateway/v2/app/subtitle") {
$host = CUSTOM_HOST_SUB;
} elseif ($path == "/pgc/player/api/playurl" || $path == "/pgc/player/web/playurl") {

@ -0,0 +1,40 @@
<?php
// 防止外部破解
if(!defined('SYSTEM')) {exit(BLOCK_RETURN);}
define('ACCESS_KEY', @$_GET['access_key']);
define('CID', @$_GET['cid']);
define('EP_ID', @$_GET['ep_id']);
define('SS_ID', @$_GET['season_id']);
define('BILIROAMING_VERSION', @$_SERVER['HTTP_X_FROM_BILIROAMING']);
if (BILIROAMING_VERSION == '') {
if (BILIROAMING == 1 && WEB_ON == 0) { //仅限漫游用户且未开放web脚本
exit(BLOCK_RETURN);
} else if (@$_GET['area'] == '' || @$_GET['area'] == 'false') { //web脚本
define('AREA', 'noarea');
} else {
define('AREA', @$_GET['area']);
}
} else if (@$_GET['area'] == '') { //适配老漫游版本
define('AREA', 'oldversion');
} else {
define('AREA', @$_GET['area']);
}
if (@$_GET['ts'] == '') {
define('TS', time());
}else{
define('TS', @$_GET['ts']);
}
$baned = 0;
if (in_array(EP_ID, $epid_list) && BAN_EP == 1) {
$baned = 1;
}
if (in_array(CID, $cid_list) && BAN_CID == 1) {
$baned = 1;
}
if (in_array(AREA, $BAN_SERVER_AREA)) {
$baned = 1;
exit(BLOCK_RETURN);
}
?>
Loading…
Cancel
Save