-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathindex.php
40 lines (37 loc) · 1.14 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
header('Access-Control-Allow-Origin:*');
header('Content-type: application/json');
ini_set('display_errors','off');
error_reporting(E_ALL || ~E_NOTICE);
require 'src/images_spider.php';
$url = $_REQUEST['url'];
use Images_spider\Images;
$api = new Images;
if (strpos($url,'weibo') !== false){
$arr = $api->weibo($url);
} elseif (strpos($url, 'kuaishou') !== false){
$arr = $api->kuaishou($url);
} elseif (strpos($url, 'pipix') !== false){
$arr = $api->pipixia($url);
} elseif (strpos($url, 'izuiyou') !== false){
$arr = $api->zuiyou($url);
} elseif (strpos($url, 'xhslink') !== false){
$arr = $api->xhs($url);
} elseif (strpos($url, 'douyin') !== false){
$arr = $api->douyin($url);
} else {
$arr = array(
'code' => 201,
'msg' => '不支持您输入的链接'
);
}
if (!empty($arr)){
echo json_encode($arr, JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}
else{
$arr = array(
'code' => 201,
'msg' => '解析失败',
);
echo json_encode($arr, JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}