auto update

dependabot/npm_and_yarn/ushio/www/session/lodash-4.17.15
iotcat 5 years ago
parent 377758347e
commit acd1aa1dc0
  1. 7
      ushio/www/api/functions.php
  2. 10
      ushio/www/api/video/getInfo.php
  3. 32
      ushio/www/api/video/index.php
  4. 63
      ushio/www/api/video/intro.html
  5. 201
      yimian/.viminfo

@ -285,6 +285,13 @@ function getIp()
}
/* obs get video */
function getVideo($path, $time = 120*60){
return trim(exec("obs sign obs://yimian-video/". $path ." -e=". $time));
}
/* obs get img */
function getImg($path, $time = 300){

@ -0,0 +1,10 @@
<?php
include '../functions.php';
header('Access-Control-Allow-Origin:*');
$type = $_REQUEST['type'];
$arr = getImgsInfo($type);
echo json_encode($arr);

@ -0,0 +1,32 @@
<?php
include '../functions.php';
/* anti ddos */
/*if(!isset($_COOKIE['_token__']) || $_COOKIE['_token__'] != md5(date('Y-m-d-H'))) {
setcookie("_token__",md5(date('Y-m-d-H')),time()+1*3600);
header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], true, 301);
}*/
header('content-type: video/mp4');
$path = $_REQUEST['path'];
if($path){
returnVideo($path);
}
yimian__log("log_api", array("api" => "video", "timestamp" => date('Y-m-d H:i:s', time()), "ip" => ip2long(getIp()), "_from" => get_from(), "content" => $path));
function returnVideo($path){
$url = getVideo($path);
header("Location: $url");
}

@ -0,0 +1,63 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>随机图片 API</title>
<meta name="theme-color" content="#fd4b5c">
<script src="https://cdn.yimian.xyz/ushio-js/ushio-head.min.js"></script>
</head>
<body>
<style type="text/css">h3:hover {box-shadow:0px 0px 8px #D1D1D1;}</style>
<div style="box-shadow: 5px 5px 25px 0 rgba(46,61,73,.2);border-radius:15px;font-size:13px;width:950px;font-family:微软雅黑,'Helvetica Neue',Arial,sans-serif;margin:10px auto 0px;border:0px solid #eee;max-width:100%;">
<div style="width:100%;background-color: #3174ed;background-image: linear-gradient(90deg, #3174ed 0%, #FA8BFF 35%, #3fd9fb 88%);color:#FFFFFF;border-radius:15px 15px 0 0;">
<h2 style="font-size:15px;word-break:break-all;padding:20px 32px;margin:0;text-align:center">随机图 - API</h2></div>
<div style="margin:0px auto;width:90%">
<h3 style="-webkit-transition: all .2s cubic-bezier(0, 0, 0, 0.48);-moz-transition: all .2s ease;border:.0625rem solid #fafafa;background:#fafafa repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);margin:15px 0px;padding:20px;border-radius:5px;font-size:14px;color:#333;"># 随机图片API请求方式 #
<ul>
<li>Method: GET/POST</li></ul>
<hr># 请求地址 #
<br/>
<a style="color:#fd4b5c;text-decoration:none;">https://api.yimian.xyz/img</a>
<br/># 参数 #
<br/>
<li>type //type=moe二次元(default)/wallpaper风景壁纸/head头像/koino幼犬酱</li>
<li>size //size=1920x1080图片大小/ 格式: ??x?? / ??-??x?? / ??x??-?? / ??-??x??-?? / ??x* / *x?? / *x* (default)</li>
<li>id //id=15 根据图片id获取图片,需要先指定type,默认为moe</li>
<li>display //display=true 是否直接输出图片(很慢),而不是302重定向到临时地址(默认,建议)</li>
<li>path //path=koino/img_7_849x906_96_koino_normal.jpg 直接根据地址获取图片,优先级高于type</li>
<li>R18 //R18=true 是否展示18禁图片,默认不展示</li>
<hr># 返回数据 #
<br/>
<div style="width:100%;background-color: #000;background-image: linear-gradient(90deg, #6694ed 0%,);color:#FFFFFF;border-radius:5px">本API无返回数据,直接输出图片
<br/></div>
<hr># 备注 #
<br/>更多用法参考
<a href="https://www.eee.dog/tech/rand-pic-api.html">https://www.eee.dog/tech/rand-pic-api.html</a>
<br/>
<hr># 示例 #
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/img?type=koino</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/img?type=koino&display=true</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/img?type=moe&size=1920x1080&display=true</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/img?type=moe&size=666-888x999-2000&display=true</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/img?type=moe&size=*x999-2000&display=true</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/img?type=moe&id=15&display=true</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/img?path=koino/img_7_849x906_96_koino_normal.jpg</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/img?type=koino&R18=true&display=true</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/img?type=wallpaper&display=true</a></h3>
</div>
</div>
</body>
<script src="https://cdn.yimian.xyz/ushio-js/ushio-footer.min.js"></script>
</html>

@ -8,21 +8,23 @@
# hlsearch on (H) or off (h):
~H
# Last Search Pattern:
~MSle0~/api.yimian
~MSle0~/getImg
# Last Substitute String:
$
# Command Line History (newest to oldest):
:wq
:q
:wq
:q!
:!q
:w
:s
:q!
:Q!
:Wq
# Search String History (newest to oldest):
?/getImg
?/api.yimian
?/echo
@ -33,50 +35,127 @@ $
# Input Line History (newest to oldest):
# Registers:
"0 CHAR 0
$usrMail = Array(
"liu" => "i@yimian.xyz",
"yang" => "boyao1999@163.com",
"li" => "x.li203@student.liverpool.ac.uk",
"jia" => "mingranjia@163.com",
"zheng" => "hao.zheng17@student.xjtlu.edu.cn"
);
""0 CHAR 0
/* obs get img */
function getImg($path, $time = 300){
return str_replace('yimian-image.obs.cn-east-2.myhuaweicloud.com:443','image.yimian.xyz',trim(exec("obs sign obs://yimian-image/". $path ." -e=". $time)));
}
"1 CHAR 0
function getMatchedKeys($str, $arr){
if(!is_array($str)){
$o = array();
foreach($arr as $key=>$val){
if($val >= $str - $GLOBALS['range'] && $val <= $str + $GLOBALS['range']) array_push($o, $key);
}
return $o;
}else{
$o = array();
foreach($arr as $key=>$val){
if($val >= $str[0] - $GLOBALS['range'] && $val <= $str[1] + $GLOBALS['range']) array_push($o, $key);
}
return $o;
}
}
"2 CHAR 0
elseif($type){
""1 LINE 0
Last name:<br>
"2 LINE 0
<p>如果您点击提交,表单数据会被发送到名为 demo_form.asp 的页面。</p>
$arr = getImgsInfo($type);
if($id){
$pos = array_search($id, $arr[1]);
if($pos) $path = $type. '/' .$arr[0][$pos];
}
if(!$size && !$path){
$path = $type. '/' .$arr[0][array_rand($arr[0])];
}elseif(strpos($size, '-') && !$path){
$arr_size = explode('x',$size);
if(strpos($arr_size[0], '-')) $arr_size_length = explode('-',$arr_size[0]);
else $arr_size_length = $arr_size[0];
if(strpos($arr_size[1], '-')) $arr_size_high = explode('-',$arr_size[1]);
else $arr_size_high = $arr_size[1];
$arr_length = getMatchedKeys($arr_size_length, $arr[2]);
$arr_high = getMatchedKeys($arr_size_high, $arr[3]);
if($arr_size[0] == '*') $arr_keys = $arr_high;
elseif($arr_size[1] == '*') $arr_keys = $arr_length;
else $arr_keys = array_intersect($arr_length, $arr_high);
if(!count($arr_keys)){
header('content-type: application/json');
echo json_encode(array("err"=>"Can not find any images matching Size $size in Type $type!!"));
die();
}
do{
$index = array_rand($arr_keys);
}while($R18 != true && $arr[6][$arr_keys[$index]] != "normal");
$path = $type. '/' .$arr[0][$arr_keys[$index]];
}elseif(!$path){
$arr_size = explode('x',$size);
$arr_length = getMatchedKeys($arr_size[0], $arr[2]);
$arr_high = getMatchedKeys($arr_size[1], $arr[3]);
if($arr_size[0] == '*' && $arr_size[1] == '*') $arr_keys = getMatchedKeys(array(0=>0,1=>9999), $arr[2]);
elseif($arr_size[0] == '*') $arr_keys = $arr_high;
elseif($arr_size[1] == '*') $arr_keys = $arr_length;
else $arr_keys = array_intersect($arr_length, $arr_high);
if(!count($arr_keys)){
header('content-type: application/json');
echo json_encode(array("err"=>"Can not find any images matching Size $size in Type $type!!"));
die();
}
do{
$index = array_rand($arr_keys);
}while($R18 != true && $arr[6][$arr_keys[$index]] != "normal");
$path = $type. '/' .$arr[0][$arr_keys[$index]];
"3 LINE 0
<br><br>
"4 LINE 0
<input type="text" name="lastname" value="Mouse">
"5 LINE 0
$s = '';
if(isset($range) && $range > 0) $range = $range; else $range = 0;
"6 LINE 0
yimian__mail('i@yimian.xyz', 'Hi~', 'Test from Yimian LIU', 'ERP TEST');
if($R18 != "true") $R18 = false; else $R18 = true;
"7 LINE 0
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
if($display != "true") $display = false; else $display = true;
"8 LINE 0
if(!isset($path)) $path = null;
"9 LINE 0
$tmp_total = 0;
if(!isset($size)) $size = null;
"- CHAR 0
# File marks:
'0 170 11 ~/www/settlement/api/index.php
'1 573 1 ~/www/settlement/index.html
'2 5 105 ~/www/settlement/login.html
'3 289 17 ~/www/settlement/index.html
'4 10 37 ~/www/settlement/login.html
'5 1 0 ~/www/settlement/login.php
'6 282 1 ~/www/settlement/index.html
'7 27 49 ~/www/settlement/api/index.php
'8 6 0 ~/www/settlement/api/test.php
'9 187 0 ~/www/settlement/api/index.php
'0 32 0 /home/ushio/www/api/video/index.php
'1 291 3 /home/ushio/www/api/functions.php
'2 20 0 /home/ushio/www/api/video/index.php
'3 29 18 /home/ushio/www/api/video/index.php
'4 293 0 /home/ushio/www/api/functions.php
'5 298 128 /home/ushio/www/api/functions.php
'6 31 0 /home/ushio/www/api/video/index.php
'7 1 0 /home/ushio/www/api/video/in
'8 170 11 ~/www/settlement/api/index.php
'9 573 1 ~/www/settlement/index.html
# Jumplist (newest first):
-' 32 0 /home/ushio/www/api/video/index.php
-' 20 0 /home/ushio/www/api/video/index.php
-' 291 3 /home/ushio/www/api/functions.php
-' 293 0 /home/ushio/www/api/functions.php
-' 29 4 /home/ushio/www/api/video/index.php
-' 31 0 /home/ushio/www/api/video/index.php
-' 298 4 /home/ushio/www/api/functions.php
-' 491 0 /home/ushio/www/api/functions.php
-' 1 0 /home/ushio/www/api/functions.php
-' 541 0 /home/ushio/www/api/functions.php
-' 2 0 /home/ushio/www/api/functions.php
-' 1 0 /home/ushio/www/api/video/index.php
-' 1 0 /home/ushio/www/api/video/in
-' 170 11 ~/www/settlement/api/index.php
-' 27 0 ~/www/settlement/api/index.php
-' 573 1 ~/www/settlement/index.html
@ -162,21 +241,44 @@ $
-' 4 0 ~/www/settlement/api/index.php
-' 73 93 ~/www/settlement/func/functions.php
-' 70 0 ~/www/settlement/func/functions.php
-' 78 0 ~/www/settlement/func/functions.php
-' 87 0 ~/www/settlement/func/functions.php
-' 117 73 ~/www/settlement/func/functions.php
-' 118 0 ~/www/settlement/func/functions.php
-' 119 0 ~/www/settlement/func/functions.php
-' 121 0 ~/www/settlement/func/functions.php
-' 122 0 ~/www/settlement/func/functions.php
-' 151 66 ~/www/settlement/func/functions.php
-' 120 0 ~/www/settlement/func/functions.php
-' 86 0 ~/www/settlement/func/functions.php
-' 152 0 ~/www/settlement/func/functions.php
-' 157 0 ~/www/settlement/func/functions.php
# History of marks within files (newest to oldest):
> /home/ushio/www/api/video/index.php
" 32 0
^ 20 0
. 29 18
+ 12 30
+ 15 0
+ 16 0
+ 23 0
+ 21 0
+ 23 43
+ 19 14
+ 28 19
+ 30 4
+ 33 0
+ 29 18
> /home/ushio/www/api/functions.php
" 291 3
^ 291 4
. 291 74
+ 286 0
+ 295 15
+ 296 36
+ 298 130
+ 286 0
+ 288 15
+ 289 37
+ 291 130
+ 294 0
+ 291 74
> /home/ushio/www/api/video/in
" 1 0
^ 1 0
> ~/www/settlement/api/index.php
" 170 11
^ 170 12
@ -590,9 +692,6 @@ $
. 1 7
+ 1 7
> /home/ushio/www/api/functions.php
" 2 0
> ~/www/settlement/imgbed/js/main.js
" 52 44
^ 52 45
@ -656,11 +755,3 @@ $
+ 10 36
+ 18 0
+ 10 43
> ~/www/settlement/imgbed/js/jquery.min.js
" 5 40
^ 1 0
> ~/www/settlement/imgbed/js/jquery.hwLayer.js
" 10 0
^ 1 0

Loading…
Cancel
Save