master
cn.yimian.xyz 3 years ago
parent 657f3bc4d1
commit 58419f0351
  1. 3
      functions.php
  2. 13
      index.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);
}

@ -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{

Loading…
Cancel
Save