Compare commits

..

No commits in common. '7ce7aea0fd25a5a5f3d1fe40106caf498e9f6e94' and 'ffb8658fcd56579d06c8587eb64da73d721eb713' have entirely different histories.

  1. 13
      functions.php
  2. 3
      index.php

@ -206,7 +206,6 @@ function get_from(){
if($_SERVER['HTTP_REFERER']) return $_SERVER['HTTP_REFERER'];
elseif($_REQUEST['from']) return $_REQUEST['from'];
return '';
}
function get_from_domain(){
@ -310,20 +309,10 @@ function getImgOneindex($path){
return str_replace('yimian-image.obs.cn-east-2.myhuaweicloud.com:443','onedrive.yimian.xyz/img',obsSign($path, $time));
}
function getImgCDNProxy($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 '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);
}
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://fastly.jsdelivr.net/npm/ushio-api-img-moe@5.0.'.intval($arr[1][0]/10).'',$path);
//https://testingcf.jsdelivr.net/
//https://gcore.jsdelivr.net/
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);
}

@ -170,8 +170,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'] > 0 || $GLOBALS['_ip'] > 0)) || ($GLOBALS['_ip'] > 0))*/) {
if(get_from()=='')$url = getImgCDN($path);
else $url = getImgCDNProxy($path);
$url = getImgCDN($path);
//$url = getImgOneindex($path);
// $url = getImg($path);
}else{

Loading…
Cancel
Save