master
cn.yimian.xyz 2 years ago
parent 3128dc2304
commit ffb8658fcd
  1. 4
      functions.php
  2. 4
      index.php

@ -312,7 +312,7 @@ function getImgOneindex($path){
function getImgCDN($path){
if(stripos($path, 'moe') !== false){
preg_match_all('/img_(\S*?)_(\d{2,4})x(\d{2,4})_(\S*?)_(\S*?)_(\S*?).(jpe?g|png|gif|svg)\b/', $path, $arr);
return str_replace('moe','https://cdn.jsdelivr.net/npm/ushio-api-img-moe@5.0.'.intval($arr[1][0]/10).'',$path);
return 'https://proxy.yimian.xyz/get/?url='.base64_encode(str_replace('moe','https://cdn.jsdelivr.net/npm/ushio-api-img-moe@5.0.'.intval($arr[1][0]/10).'',$path));
}
return getImg($path);
}
@ -322,7 +322,7 @@ function getImgCDNwallpaper($path){
$date = strtotime($arr[1][0].' 00:00:00');
$dateline = strtotime('2021-07-11 00:00:00');
if($date < $dateline)
return 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));
else
return getImg($path);
}

@ -170,10 +170,12 @@ 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))*/) {
$url = getImgCDN($path);
$url = getImgCDN($path);
//$url = getImgOneindex($path);
// $url = getImg($path);
}else{
if($GLOBALS['type'] == 'wallpaper') {
//$url = getImg($path);
$url = getImgCDNwallpaper($path);
}else{
$url = getImg($path);

Loading…
Cancel
Save