Compare commits

...

2 Commits

Author SHA1 Message Date
iotcat 8dbe8ba339 ushio.yimian 2 years ago
cn.yimian.xyz a885d8bcb6 before mv 2 years ago
  1. 13
      functions.php
  2. 7
      index.php

@ -286,8 +286,8 @@ function getIp()
}
/* obs sdk */
require '/home/lib/huaweicloud-sdk-php-obs/vendor/autoload.php';
require '/home/lib/huaweicloud-sdk-php-obs/obs-autoloader.php';
require __DIR__ . '/../../../lib/huaweicloud-sdk-php-obs/vendor/autoload.php';
require __DIR__ . '/../../../lib/huaweicloud-sdk-php-obs/obs-autoloader.php';
use Obs\ObsClient;
@ -336,8 +336,15 @@ function getImgCDNwallpaper($path){
preg_match_all('/img_(\S*?)_(\d{2,4})x(\d{2,4})_(\S*?)_(\S*?)_(\S*?).(jpe?g|png|gif|svg)\b/', $path, $arr);
$date = strtotime($arr[1][0].' 00:00:00');
$dateline = strtotime('2021-07-11 00:00:00');
//$d = 'https://testingcf.jsdelivr.net/';
$d = 'https://gcore.jsdelivr.net/';
// $d = 'https://fastly.jsdelivr.net/';
// $d = 'https://cdn.jsdelivr.net/';
// $d = 'https://originfastly.jsdelivr.net/';
// $d = 'https://quantil.jsdelivr.net/';
if($date < $dateline)
return 'https://proxy.yimian.xyz/get/?url='.base64_encode(str_replace('wallpaper','https://cdn.jsdelivr.net/npm/ushio-api-img-wallpaper@1.1'.date('y.nw', $date).'',$path));
//return 'https://proxy.yimian.xyz/get/?url='.base64_encode(str_replace('wallpaper','https://cdn.jsdelivr.net/npm/ushio-api-img-wallpaper@1.1'.date('y.nw', $date).'',$path));
return str_replace('wallpaper',$d.'npm/ushio-api-img-wallpaper@1.1'.date('y.nw', $date).'',$path);
else
return getImg($path);
}

@ -16,7 +16,7 @@ $whiteList = array(
// 'img.yimian.xyz',
'acg.watch',
'iotcat.me',
'ushio.cool',
'ushio.yimian.xyz',
'yimian.xyz',
'guide.yimian.xyz',
'cp-acc.yimian.xyz',
@ -170,8 +170,9 @@ 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'] > 0 || $GLOBALS['_ip'] > 0)) || ($GLOBALS['_ip'] > 0))*/) {
if(get_from()=='')$url = getImgCDN($path);
else $url = getImgCDNProxy($path);
$url = getImgCDN($path);
//if(get_from()=='')$url = getImgCDN($path);
//else $url = getImgCDNProxy($path);
//$url = getImgOneindex($path);
// $url = getImg($path);
}else{

Loading…
Cancel
Save