This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
/
index.php
165 lines (156 loc) · 3.5 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>网盘直链下载</title>
</head>
<body>
<?php
require_once('functions.php');
include_once('config.php');
ini_set('user_agent',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36;
zh-CN; //蓝奏云必须设置这个且保持不变才能拿到数据
Nexus 4 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19');
//屏蔽显示
error_reporting(0);
//允许所有域访问
header("Access-Control-Allow-Origin: *");
//设置中文
header("Content-type:text/html;charset=utf-8");
//传值为谷歌网盘的处理
if (!empty($_GET['id'])){
$id = $_GET['id'];
google_drive($id);
}
//蓝奏云直链获取
elseif(!empty($_GET['lz'])){
$lz = $_GET['lz'];
$direct_link = lzy($lz);
if ($direct_link)
{
echo $direct_link;
}
else{
echo "获取直链失败,请刷新重试";
}
}
//蓝奏云直链下载
elseif(!empty($_GET['lzd'])){
$lz = $_GET['lzd'];
$direct_link = lzy($lz);
if ($direct_link)
{
header("Location: $direct_link"); //直接跳转到下载链接
}
else{
echo "获取直链失败,请刷新重试";
}
}
//360直链下载
elseif(!empty($_GET['360'])){
$id=$_GET['360'];
$direct_link = link_360($id);
echo $direct_link;
header("Location: $direct_link"); //跳转到直链下载
}
else{
if(empty($site_name)){
$site_name = "https://网站地址/";
}
echo "
<h1>DriveDirectLink</h1>
<p>DriveDirectLink 网盘直链下载,支持谷歌,蓝奏云</p>
<h2>谷歌网盘直链下载</h2>
<h3>使用方法</h3>
<p>格式如下:
<br>
<code>
".$site_name."?id=文件ID
</code>
例如
<br>
google drive 分享链接
<br>
<code>
https://drive.google.com/open?id=1TSlvfrRrGrT8a_84iFDIkSwrxU_53D6T
</code>
<br>
直链地址
<br>
<code>
".$site_name."?id=1TSlvfrRrGrT8a_84iFDIkSwrxU_53D6T
</code></p>
<h2>蓝奏云</h2>
<h3>获取直链地址</h3>
<p>此方法会获取并展示直链地址,而不会直接下载
<br>
格式如下:
<br>
<code>
".$site_name."?lz=文件ID
</code>
<br>
例如
<br>
蓝奏云分享链接
<br>
<code>
https://www.lanzous.com/ibvifch
</code>
<br>
直链获取地址
<br>
<code>
".$site_name."?lz=ibvifch
</code>
<br>
注意,有时候会无法获取,刷新即可</p>
<h3>直链下载地址</h3>
<p>此方法会直接跳转下载,但是经过测试发现,国外机器使用直链下载容易验证码,酌情使用
<br>
格式如下
<br>
<code>
".$site_name."?lzd=文件ID
</code>
<br>
例如
<br>
蓝奏云分享链接
<br>
<code>
https://www.lanzous.com/ibvifch
</code>
<br>
直链下载地址
<br>
<code>
".$site_name."?lzd=ibvifch
</code></p>
<h2>360网盘直链下载</h2>
<h3>使用方法</h3>
<p>只支持单个文件且无提取码
<p>格式如下:
<br>
<code>
".$site_name."?360=文件ID
</code>
例如
<br>
360网盘 分享链接
<br>
<code>
https://yunpan.360.cn/surl_yYgjWMz8GhU
</code>
<br>
直链地址
<br>
<code>
".$site_name."?360=surl_yYgjWMz8GhU
</code></p>
项目地址:<a href=\"https://github.com/Kimiato/DriveDirectLink\"> https://github.com/Kimiato/DriveDirectLink </a>
";
}
?>
</body>