v2.9.10
1. 不缓存泰版搜索及字幕
2. 删除无意义空格
pull/6/head
david082321 4 years ago
parent ab86efd417
commit f2ccdee75d

@ -6,7 +6,7 @@
## 下载:
* [下载(GitHub) v2.9.8](https://github.com/david082321/BiliRoaming-PHP-Server/raw/main/Server_v2.9.8.zip)
* [下载(GitHub) v2.9.10](https://github.com/david082321/BiliRoaming-PHP-Server/raw/main/Server_v2.9.10.zip)
## 用法:
@ -40,21 +40,23 @@
* 在配置文件中加入以下代码
server
{
#...(中间略过,请加在配置文件最底下)...
rewrite "^/pgc/player/api/playurl?(.*)$" /pgc/player/api/playurl/index.php?$1 last;
rewrite "^/intl/gateway/v2/ogv/playurl?(.*)$" /intl/gateway/v2/ogv/playurl/index.php?$1 last;
rewrite "^/intl/gateway/v2/app/search/type?(.*)$" /intl/gateway/v2/app/search/type/index.php?$1 last;
rewrite "^/intl/gateway/v2/app/subtitle?(.*)$" /intl/gateway/v2/app/subtitle?$1 last;
}
server
{
#...(中间略过,请加在配置文件最底下)...
rewrite "^/pgc/player/api/playurl?(.*)$" /pgc/player/api/playurl/index.php?$1 last;
rewrite "^/pgc/player/web/playurl?(.*)$" /pgc/player/web/playurl/index.php?$1 last;
rewrite "^/intl/gateway/v2/ogv/playurl?(.*)$" /intl/gateway/v2/ogv/playurl/index.php?$1 last;
rewrite "^/intl/gateway/v2/app/search/type?(.*)$" /intl/gateway/v2/app/search/type/index.php?$1 last;
rewrite "^/intl/gateway/v2/app/subtitle?(.*)$" /intl/gateway/v2/app/subtitle?$1 last;
}
## (非必要步骤) 缓存

@ -41,7 +41,7 @@ function get_cache(){
global $dbh;
global $refresh_cache;
$ts = time();
$sqlco = "SELECT * FROM `cache` WHERE `area` = '".AREA."' AND `type` = '".TYPE."' AND `cid` = '".CID."' AND `ep_id` = '".EP_ID."'";
$cres = $dbh -> query($sqlco);
$vnum = $cres -> fetch();

@ -1,7 +1,7 @@
<?php
// 防止外部破解
define('SYSTEM', TRUE);
define('VERSION', '2.9.9');
define('VERSION', '2.9.10');
// 加上json的Header
header('Content-Type: application/json; charset=utf-8');
// 加载配置
@ -28,7 +28,7 @@ if ($path=="/intl/gateway/v2/ogv/playurl") {
}
} elseif (WEB_ON == 1) {
$host = CUSTOM_HOST_DEFAULT;
$path = "/pgc/player/web/playurl";
$path = "/pgc/player/web/playurl";
header("Access-Control-Allow-Origin: https://www.bilibili.com");
header("Access-Control-Allow-Credentials: true");
} else {
@ -58,10 +58,14 @@ if ($path!="/intl/gateway/v2/app/search/type" && $path!="/intl/gateway/v2/app/su
}
// 获取缓存
if (SAVE_CACHE==1) {
include ("cache.php");
$cache = get_cache();
if ($cache != "") {
exit($cache);
if ($path=="/intl/gateway/v2/app/search/type" || $path=="/intl/gateway/v2/app/subtitle") {
// 不缓存
}else{
include ("cache.php");
$cache = get_cache();
if ($cache != "") {
exit($cache);
}
}
}
// 指定ip回源
@ -79,7 +83,11 @@ if (IP_RESOLVE==1) {
print($output);
// 写入缓存
if (SAVE_CACHE==1) {
write_cache();
if ($path=="/intl/gateway/v2/app/search/type" || $path=="/intl/gateway/v2/app/subtitle") {
// 不缓存
}else{
write_cache();
}
}
function get_webpage($url,$host="",$ip=""){

@ -15,7 +15,7 @@ function replace(){
}elseif ($path!="/intl/gateway/v2/app/search/type" && $path!="/intl/gateway/v2/app/subtitle"){
$type = "web";
}
if (REPLACE_TYPE=="hlw"){
$url = 'https://black.qimo.ink/hlw.php?type='.$type;
}else if (REPLACE_TYPE=="tom"){
@ -28,8 +28,8 @@ function replace(){
$url = 'https://black.qimo.ink/TandJ.php?type='.$type;
}
$output = get_webpage($url);
// 分析 output
$array = json_decode($output, true);
$timelength = $array['timelength'];
@ -39,7 +39,7 @@ function replace(){
$a_base_url = $array['a_base_url'];
$a_bandwidth = $array['a_bandwidth'];
$a_backup_url = $array['a_backup_url'];
if ($type=="web"){
exit($output);
}
@ -53,7 +53,7 @@ function replace(){
// 替换视频
// 好像是count不到正确数量不晓得有没有人会改的
//$v_count = count($array2['data']['video_info']['stream_list']);
//$v_count = count($array2['data']['video_info']['stream_list']);
for($j=0 ; $j<5; $j++){
$array2['data']['video_info']['stream_list'][$j]['dash_video']['base_url'] = $base_url;
$array2['data']['video_info']['stream_list'][$j]['dash_video']['backup_url'] = $backup_url;

Loading…
Cancel
Save