Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
5ime committed Jan 6, 2022
1 parent 2437c04 commit 14164d3
Show file tree
Hide file tree
Showing 1,074 changed files with 32,405 additions and 176,808 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.idea
/.vscode
*.log
.env
.DS_Store
3 changes: 2 additions & 1 deletion .htaccess
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
</IfModule>
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# 食用方法

Wiki:https://github.com/5ime/API-Admin/wiki

此程序基于ThinkPHP5.0 PHP版本需`≥7.0`
此程序基于ThinkPHP5.1 PHP版本需`7.0-7.3`之间。

`Nginx`请设置如下`伪静态` `Apache`无需配置 运行目录`默认`即可
```
Expand All @@ -15,13 +13,12 @@ location / {

将程序上传至网站根目录,访问`域名/install`进行安装操作

默认账号密码为`admin` `123456` 如需添加API 请将API放入`api`目录

**新增的API文档编写请参考:https://tenapi.cn/doc/**
操作指南请前往:https://github.com/5ime/API-Admin/wiki

Bug反馈请提交`Issues`

# 更新日志

- 2020-4-1 提交API-Admin beta版 新增`随机动漫图API`
- 2020-4-7 新增`抖音无水印解析API`,`IP签名图API`,`免KEY加群API`
- 2020-4-15 新增安装页面/优化部分代码 新增`网站ICO获取API`,`网站icp备案查询API`,`历史上的今天API`,`QQ头像获取API`,`QQ在线状态查询API`,`服务器信息获取API`,`网站标题获取API`,`爱站权重获取API`,`城市天气获取API`,`随机一言API`
Expand All @@ -34,6 +31,8 @@ Bug反馈请提交`Issues`
- 2021-1-29 优化部分代码,后台新增API总调用数统计、API搜索功能、API分类功能、程序更新检测功能、API列表分页...
- 开源了聚合短视频去水印解析API https://github.com/5ime/video_spider
- 2021-8-22 修复几处错误
- 2022-1-6 大更新

# 免责声明

本仓库只为学习研究,如涉及侵犯个人或者团体利益,请与我取得联系,我将主动删除一切相关资料,谢谢!
18 changes: 0 additions & 18 deletions SECURITY.md

This file was deleted.

6 changes: 5 additions & 1 deletion api/bing/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header('Access-Control-Allow-Origin:*');
$str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
if(preg_match("/<url>(.+?)<\/url>/ies",$str,$matches)){
Expand Down
File renamed without changes.
54 changes: 54 additions & 0 deletions api/black.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
$file = '../black.data';
$data = fopen($file, 'r');
$data = fread($data, filesize($file));
$data = json_decode($data,true);

if(in_array(get_ip(),$data)){
$Json = array(
'code' => 201,
'msg' => '您已被拉黑',
);
$Json = json_encode($Json,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
echo stripslashes($Json);
die;
}
if(!empty(get_referer())){
if(in_array(get_referer(),$data)){
$Json = array(
'code' => 201,
'msg' => '您已被拉黑',
);
$Json = json_encode($Json,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
echo stripslashes($Json);
die;
}
}

function get_referer()
{
$referer = @$_SERVER['HTTP_REFERER'];
$referer = str_replace('http://', '', $referer);
$referer = str_replace('https://', '', $referer);
$referer = str_replace('www.', '', $referer);
$referer = str_replace('/', '', $referer);
$referer = str_replace('.', '', $referer);
return $referer;
}

function get_ip()
{
if(!empty($_SERVER['HTTP_CLIENT_IP'])){
$cip = $_SERVER['HTTP_CLIENT_IP'];
}else if(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
$cip = $_SERVER["HTTP_X_FORWARDED_FOR"];
}else if(!empty($_SERVER["REMOTE_ADDR"])){
$cip = $_SERVER["REMOTE_ADDR"];
}else{
$cip = '';
}
preg_match("/[\d\.]{7,15}/", $cip, $cips);
$cip = isset($cips[0]) ? $cips[0] : 'unknown';
unset($cips);
return $cip;
}
8 changes: 0 additions & 8 deletions api/count.php

This file was deleted.

1 change: 0 additions & 1 deletion api/counter.dat

This file was deleted.

6 changes: 5 additions & 1 deletion api/douyin/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
$url = @$_GET['url'];
if ($url != null) {
$loc = get_headers($url, true)["location"];
Expand Down
6 changes: 5 additions & 1 deletion api/dwzrec/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header('Access-Control-Allow-Origin:*');
header('Content-type:application/json; charset=utf-8');
!empty($_GET['url']) ? $api = $_GET['url'] : exit(json_encode([
Expand Down
6 changes: 5 additions & 1 deletion api/huoshan/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
/**
* Name:火山短视频
*/
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);

header('Access-Control-Allow-Origin:*');
header('Content-Type:text/json;charset=utf8');
Expand Down
6 changes: 5 additions & 1 deletion api/ico/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
if(isset($_GET['url'])){
$site='http://';
$url=trim($site.$_GET['url']);
Expand Down
6 changes: 5 additions & 1 deletion api/icp/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
* @version 1.0.0
* @link http://github.com/5ime/api-admin/api/icp
*/
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header("Access-Control-Allow-Origin:*");
header('Content-type: application/json');
$url = @$_GET['url'];
Expand Down
6 changes: 5 additions & 1 deletion api/img/acg.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?php
//读取文本
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
$str = explode("\n", file_get_contents('sinetxt.txt'));
$k = rand(0,count($str));
$sina_img = str_re($str[$k]);
Expand Down
6 changes: 5 additions & 1 deletion api/ipinfo/index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?php $counter = intval(file_get_contents("counter.dat")); ?>
<?php include 'function.php';?>
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header("Content-type: image/JPEG");
$im = imagecreatefromjpeg("xhxh.jpg");
$ip = $_SERVER["REMOTE_ADDR"];
Expand Down
6 changes: 5 additions & 1 deletion api/laji/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header('Access-Control-Allow-Origin:*');header('Content-type:application/json; charset=utf-8');error_reporting(0);function myCurl($url){
$ch = curl_init(); // Curl 初始化
$timeout = 30; // 超时时间:30s
Expand Down
6 changes: 5 additions & 1 deletion api/lanzou/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
* @version 1.0.0
* @link http://github.com/5ime/Lanzou_api
*/
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header('Access-Control-Allow-Origin:*');
header('Content-type: application/json');
error_reporting(0);
Expand Down
6 changes: 5 additions & 1 deletion api/lishi/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
//允许跨域
header("Access-Control-Allow-Origin:*");

Expand Down
6 changes: 5 additions & 1 deletion api/ppx/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header("Access-Control-Allow-Origin: *");
$url = @$_GET['url'];
if (strstr($url,"pipix.com")) {
Expand Down
6 changes: 5 additions & 1 deletion api/qqdwz/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?php
/*蓝优 4.23*/
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header("Access-Control-Allow-Origin:*");
header('Content-type: application/json');
!empty($_REQUEST['url']) ? $url = $_REQUEST['url'] : exit(json_encode([
Expand Down
6 changes: 5 additions & 1 deletion api/qqimg/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
error_reporting(E_ALL || ~E_NOTICE); //禁止显示PHP错误信息
$qq=$_GET['qq']; //获取URL参数
if($qq==''){
Expand Down
6 changes: 5 additions & 1 deletion api/qqzx/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
if ($_GET['qq']) {
$qq = $_GET['qq'];
$data = file_get_contents("http://webpresence.qq.com/getonline?type=1&$qq:");
Expand Down
6 changes: 5 additions & 1 deletion api/qun/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
$qqun=$_GET['qun'];
$type =$_GET['type'];
$t=time()*1000;
Expand Down
6 changes: 5 additions & 1 deletion api/serverinfo/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header('Access-Control-Allow-Origin:*');
header('Content-type: application/json');
error_reporting(0);
Expand Down
6 changes: 5 additions & 1 deletion api/site/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
Author:iami233
Author URL:https://5ime.cn
*/
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header('Access-Control-Allow-Origin:*');
header('Content-type: application/json');
error_reporting(0);
Expand Down
6 changes: 5 additions & 1 deletion api/st/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header('Access-Control-Allow-Origin:*');
header('Content-type: application/json');
error_reporting(0);
Expand Down
6 changes: 5 additions & 1 deletion api/tel/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
include "../count.php";
include '../black.php';
$path = __FILE__;
$test = explode('\\',$path);
$path = $test[count($test)-3]."/".$test[count($test)-2];
file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/getCount?id='.$path);
header("Access-Control-Allow-Origin:*");
header('Content-type: application/json');
error_reporting(0);
Expand Down
Loading

0 comments on commit 14164d3

Please sign in to comment.