重新接入moe api

master
IoTcat 5 years ago
parent bea5bbcba2
commit 0afe875477
  1. 2
      server/cn/etc/nginx/nginx.conf
  2. 33
      server/cn/home/www/api/pic/moe/index.php
  3. 0
      server/cn/home/www/api/www-api/index.php
  4. 93
      server/cn/home/www/api/www-api/moe/index.php
  5. BIN
      server/cn/home/www/api/www-api/moe/logo.ico
  6. 0
      server/cn/home/www/api/www-api/photo/index.php

@ -547,7 +547,7 @@ http {
server_name api.yimian.xyz; #1
root /home/www/api;
root /home/www/api/www-api;
index index.php index.html;
client_max_body_size 1000M;

@ -1,33 +0,0 @@
<?php
header('Access-Control-Allow-Origin:*');
if(!isset($_REQUEST['k'])){
header('Content-type: image/jpg');
if($_REQUEST['i'] == "chino"){
$id = mt_rand(1,112);
echo file_get_contents("https://yimian-image.obs.myhwclouds.com/acg/chino/".$id.".jpg");
}elseif($_REQUEST['i'] == "background"){
$id = mt_rand(1,4);
echo file_get_contents("https://yimian-image.obs.myhwclouds.com/acg/bc/".$id.".jpg");
}else{
$id = mt_rand(1,157);
echo file_get_contents("https://yimian-image.obs.myhwclouds.com/acg/moe/".$id.".jpg");
}
}else{
if($_REQUEST['i'] == "chino"){
$id = mt_rand(1,112);
header("Location: https://yimian-image.obs.myhwclouds.com/acg/chino/".$id.".jpg");
}elseif($_REQUEST['i'] == "background"){
$id = mt_rand(1,4);
header("Location: https://yimian-image.obs.myhwclouds.com/acg/bc/".$id.".jpg");
}else{
$id = mt_rand(1,157);
header("Location: https://yimian-image.obs.myhwclouds.com/acg/moe/".$id.".jpg");
}
}
die();

@ -0,0 +1,93 @@
<?php
header('Access-Control-Allow-Origin:*');
$n_chino = 120;
$n_PCBackground = 92;
$n_PhoneBackground = 32;
$n_loli = 120;
$n_normal = 149;
$n_star = 10;
$r = $_REQUEST['i'];
if(isset($_REQUEST['i'])) $r = $_REQUEST['i'];
else $r = rand_pic();
if($r == "background") $r = rand_bc();
if(!isset($_REQUEST['k'])){
header('Content-type: image/jpg');
if($r == "chino"){
$id = mt_rand(1,$n_chino);
echo file_get_contents("https://yimian-image.obs.myhwclouds.com/acg/cmoe/".$id.".jpg");
}elseif($r == "PCBackground"){
$id = mt_rand(1,$n_PCBackground);
echo file_get_contents("https://yimian-image.obs.myhwclouds.com/acg/hbc/".$id.".jpg");
}elseif($r == "PhoneBackground"){
$id = mt_rand(1,$n_PhoneBackground);
echo file_get_contents("https://yimian-image.obs.myhwclouds.com/acg/sbc/".$id.".jpg");
}elseif($r == "loli"){
$id = mt_rand(1,$n_loli);
echo file_get_contents("https://yimian-image.obs.myhwclouds.com/acg/fmoe/".$id.".jpg");
}elseif($r == "normal"){
$id = mt_rand(1,$n_normal);
echo file_get_contents("https://yimian-image.obs.myhwclouds.com/acg/dmoe/".$id.".jpg");
}elseif($r == "star"){
$id = mt_rand(1,$n_star);
echo file_get_contents("https://yimian-image.obs.myhwclouds.com/acg/star/".$id.".jpg");
}else{
$id = mt_rand(1,$n_normal);
echo file_get_contents("https://yimian-image.obs.myhwclouds.com/acg/dmoe/".$id.".jpg");
}
}else{
if($r == "chino"){
$id = mt_rand(1,$n_chino);
header("Location: https://yimian-image.obs.myhwclouds.com/acg/cmoe/".$id.".jpg");
}elseif($r == "PCBackground"){
$id = mt_rand(1,$n_PCBackground);
header("Location: https://yimian-image.obs.myhwclouds.com/acg/hbc/".$id.".jpg");
}elseif($r == "PhoneBackground"){
$id = mt_rand(1,$n_PhoneBackground);
header("Location: https://yimian-image.obs.myhwclouds.com/acg/sbc/".$id.".jpg");
}elseif($r == "loli"){
$id = mt_rand(1,$n_loli);
header("Location: https://yimian-image.obs.myhwclouds.com/acg/fmoe/".$id.".jpg");
}elseif($r == "normal"){
$id = mt_rand(1,$n_normal);
header("Location: https://yimian-image.obs.myhwclouds.com/acg/dmoe/".$id.".jpg");
}elseif($r == "star"){
$id = mt_rand(1,$n_star);
header("Location: https://yimian-image.obs.myhwclouds.com/acg/star/".$id.".jpg");
}else{
$id = mt_rand(1,$n_loli);
header("Location: https://yimian-image.obs.myhwclouds.com/acg/fmoe/".$id.".jpg");
}
}
die();
function rand_pic(){
$t = mt_rand(1,6);
if($t < 2) return "chino";
if($t < 5) return "normal";
if($t < 6) return "loli";
if($t < 7) return "star";
}
function rand_bc(){
$t = mt_rand(1,10);
if($t < 8) return "PCBackground";
return "PhoneBackground";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Loading…
Cancel
Save