From 58419f035125816681d62c13c7a41a5bd6c87285 Mon Sep 17 00:00:00 2001 From: "cn.yimian.xyz" Date: Tue, 13 Jul 2021 09:23:16 +0800 Subject: [PATCH] all_cdn --- functions.php | 3 +-- index.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/functions.php b/functions.php index fbc5dbd..de159c2 100755 --- a/functions.php +++ b/functions.php @@ -293,14 +293,13 @@ use Obs\ObsClient; /* obs get video */ function getVideo($path, $time = 120*60){ - + return obsSign($path, $time); } /* obs get img */ function getImg($path, $time = 300){ - //return str_replace('yimian-image.obs.cn-east-2.myhuaweicloud.com:443','image.yimian.xyz',obsSign($path, $time)); return obsSign($path, $time); } diff --git a/index.php b/index.php index 5e25400..269a9c3 100755 --- a/index.php +++ b/index.php @@ -13,7 +13,7 @@ $whiteList = array( 'www.eee.dog', 'api.yimian.xyz', 'home.yimian.xyz', - 'img.yimian.xyz', +// 'img.yimian.xyz', 'acg.watch', 'iotcat.me', 'ushio.cool', @@ -31,8 +31,7 @@ $whiteList = array( 'mksec.yimian.xyz', 'monitor.yimian.xyz', 'blog.yimian.xyz', - 'blank.com', - 'www.cnblogs.com' + 'blank.com' ); @@ -115,6 +114,12 @@ if($type == "moe"){ if($path){ + if(strpos($path, 'moe') !== false){ + $type = 'moe'; + }elseif(strpos($path, 'wallpaper') !== false){ + $type = 'wallpaper'; + } + returnImg($path); }elseif($type){ @@ -164,7 +169,7 @@ yimian__log("log_api", array("api" => "img", "timestamp" => date('Y-m-d H:i:s', function returnImg($path){ - if($GLOBALS['type'] != 'wallpaper' && $GLOBALS['type'] != 'imgbed' && $GLOBALS['type'] != 'path' && ((!in_array($GLOBALS['__from'], $GLOBALS['whiteList']) && ($GLOBALS['_num'] > /*2*/0 || $GLOBALS['_ip'] > /*1*/0)) || ($GLOBALS['_ip'] > /*3*/0))) { + if($GLOBALS['type'] != 'wallpaper' && $GLOBALS['type'] != 'imgbed' && $GLOBALS['type'] != 'path' /*&& ((!in_array($GLOBALS['__from'], $GLOBALS['whiteList']) && ($GLOBALS['_num'] > 0 || $GLOBALS['_ip'] > 0)) || ($GLOBALS['_ip'] > 0))*/) { $url = getImgCDN($path); //$url = getImgOneindex($path); }else{