|
|
|
@ -5,18 +5,31 @@ if(!defined('SYSTEM')){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function replace(){
|
|
|
|
|
global $host;
|
|
|
|
|
global $path;
|
|
|
|
|
// 判断来源
|
|
|
|
|
if ($path=="/intl/gateway/v2/ogv/playurl"){
|
|
|
|
|
$type = "intl";
|
|
|
|
|
}elseif ($path=="/pgc/player/api/playurl"){
|
|
|
|
|
$type = "main";
|
|
|
|
|
}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';
|
|
|
|
|
$url = 'https://black.qimo.ink/hlw.php?type='.$type;
|
|
|
|
|
}else if (REPLACE_TYPE=="tom"){
|
|
|
|
|
$url = 'https://black.qimo.ink/TandJ.php';
|
|
|
|
|
$url = 'https://black.qimo.ink/TandJ.php?type='.$type;
|
|
|
|
|
}else if (REPLACE_TYPE=="xyy"){
|
|
|
|
|
$url = 'https://bili.tuturu.top/xyyjson.php';
|
|
|
|
|
$url = 'https://bili.tuturu.top/xyyjson.php?type='.$type;
|
|
|
|
|
}else if (REPLACE_TYPE=="404"){
|
|
|
|
|
$url = 'https://'.$_SERVER['HTTP_HOST'].'/404.php';
|
|
|
|
|
$url = 'https://'.$_SERVER['HTTP_HOST'].'/404.php?type='.$type;
|
|
|
|
|
}else{
|
|
|
|
|
$url = 'https://black.qimo.ink/TandJ.php';
|
|
|
|
|
$url = 'https://black.qimo.ink/TandJ.php?type='.$type;
|
|
|
|
|
}
|
|
|
|
|
$output = get_webpage($url);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 分析 output
|
|
|
|
|
$array = json_decode($output, true);
|
|
|
|
|
$timelength = $array['timelength'];
|
|
|
|
@ -27,20 +40,14 @@ function replace(){
|
|
|
|
|
$a_bandwidth = $array['a_bandwidth'];
|
|
|
|
|
$a_backup_url = $array['a_backup_url'];
|
|
|
|
|
|
|
|
|
|
global $host;
|
|
|
|
|
global $path;
|
|
|
|
|
// 判断来源
|
|
|
|
|
if ($path=="/intl/gateway/v2/ogv/playurl"){
|
|
|
|
|
$type = "intl";
|
|
|
|
|
}elseif ($path=="/pgc/player/api/playurl"){
|
|
|
|
|
$type = "main";
|
|
|
|
|
if ($type=="web"){
|
|
|
|
|
exit($output);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 转发到指定服务器
|
|
|
|
|
$url = "https://".$host.$path."?".$_SERVER['QUERY_STRING'];
|
|
|
|
|
$url = $host.$path."?".$_SERVER['QUERY_STRING'];
|
|
|
|
|
$output2 = get_webpage($url);
|
|
|
|
|
if ($type=="intl"){
|
|
|
|
|
// 替换成hop
|
|
|
|
|
$array2 = json_decode($output2, true);
|
|
|
|
|
$array2['data']['video_info']['timelength'] = $timelength;
|
|
|
|
|
|
|
|
|
@ -60,8 +67,7 @@ function replace(){
|
|
|
|
|
$array2['data']['video_info']['dash_audio'][$j]['backup_url'] = $a_backup_url;
|
|
|
|
|
$array2['data']['video_info']['dash_audio'][$j]['bandwidth'] = $a_bandwidth;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
// 替换成hop
|
|
|
|
|
}elseif ($type=="main"){
|
|
|
|
|
$array2 = json_decode($output2, true);
|
|
|
|
|
$array2['timelength'] = $timelength;
|
|
|
|
|
|
|
|
|
|