diff --git a/functions.php b/functions.php index a1eda1a..f7256be 100755 --- a/functions.php +++ b/functions.php @@ -360,7 +360,7 @@ function getImgsInfo($type, $isFast = false){ preg_match_all('/img_(\S*?)_(\d{2,4})x(\d{2,4})_(\S*?)_(\S*?)_(\S*?).(jpe?g|png|gif|svg)\b/', $str, $arr); -//echo var_dump($str); +//echo var_dump($arr); return $arr; diff --git a/index.php b/index.php index b7b4e5c..5da6dbd 100755 --- a/index.php +++ b/index.php @@ -99,7 +99,7 @@ if($type == "moe"){ $redis->set($__num, $_num+1); $redis->set($__ip, $_ip+1); - if((!in_array($__from, $whiteList) && $_num > 50) || $_ip > 100) { + if(!in_array($__from, $whiteList) && ($_num > 50 || $_ip > 100)) { header("Location: https://api.vvhan.com/api/acgimg"); yimian__log("log_api", array("api" => "img", "timestamp" => date('Y-m-d H:i:s', time()), "ip" => ip2long(getIp()), "_from" => get_from(), "content" => 'https://api.vvhan.com/api/acgimg')); die(); diff --git a/list.php b/list.php new file mode 100644 index 0000000..50dfc7d --- /dev/null +++ b/list.php @@ -0,0 +1,31 @@ += 0) $data[0] = array_slice($data[0], 0, $limit); + +$o = array(); + +foreach($data[0] as $val){ + $o[] = array( + "name" => $val, + "url" => 'https://api.yimian.xyz/img/?path='.$type.'/'.$val + ); +} + + +echo json_encode($o);