├── LICENSE ├── README.md ├── admin ├── index.js ├── index.php ├── login.js └── login.php ├── api.php ├── assets ├── images │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 5.png │ ├── file.png │ └── unknownfile.png └── js │ └── index.js ├── function.php ├── header.php ├── index.php └── install ├── index.php └── install.sql /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 烙印 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 开源声明 2 | 本程序是免费开源项目,核心代码均未加密,其要旨是为了方便文件分享与下载,重点是GET被没落的PHP语法学习。开源项目所涉及的接口均为官方开放接口,需使用正版SVIP会员账号进行代理提取高速链接,无破坏官方接口行为,本身不存违法。仅供自己参考学习使用。诺违规使用官方会限制或封禁你的账号,包括你的IP,如无官方授权进行商业用途会对你造成更严重后果。源码仅供学习,如无视声明使用产生正负面结果(限速,被封等)与都作者无关。 3 | 4 | # 图片一阅 5 | ![image](https://github.com/codehub666/94list/assets/81606392/c961f3e4-5cc5-448b-94bf-4b9a1f225ccb) 6 | ![image](https://github.com/codehub666/94list/assets/81606392/077a488a-67fd-4a7d-807b-b4da6294a6ae) 7 | ![image](https://github.com/codehub666/94list/assets/81606392/7e854299-08f9-4983-b721-0a16f7cd9e0b) 8 | 9 | # 安装方法 10 | 建议环境需求: 11 | PHP>7.4 12 | PHP Curl 扩展 13 | PHP Mysqli扩展 14 | Mysql>5.6 15 | 直接把程序丢进这环境下进行访问,会显示可视化安装步骤,跟着步骤进行数据库连接就可以了。 16 | ![image](https://github.com/codehub666/94list/assets/81606392/641d6050-e69d-4237-9d6b-0e97affc3bde) 17 | 18 | # 原作者邮箱 19 | a94author@outlook.com 20 | # 原作者官网 21 | https://api.94speed.com/ 22 | # 演示地址 23 | 窝:https://www.uy5.net/discuss/19115.html 24 | B群管理RIO:https://58.87.88.194/ 25 | # 其他 26 | 基于laravel开发 : https://github.com/huankong233/94list-laravel 27 | yuantuo666同学 : https://github.com/yuantuo666/baiduwp-php 28 | -------------------------------------------------------------------------------- /admin/index.js: -------------------------------------------------------------------------------- 1 | const App = { 2 | data() { 3 | return { 4 | viptypemap: new Map([ 5 | [0, '普通用户'], 6 | [1, '普通会员'], 7 | [2, '超级会员'] 8 | ]), 9 | activeName: 'account_management', 10 | loading: true, 11 | add_bd_user_dialog: false, 12 | config: { 13 | user_agent: user_agent, 14 | title: title, 15 | AnnounceSwitch: AnnounceSwitch, 16 | Announce: Announce, 17 | cookie: cookie, 18 | }, 19 | illustrate: { 20 | message: "说明信息加载中", 21 | }, 22 | add_user: { 23 | getinfo: false, 24 | loading: false, 25 | cookie: null, 26 | name: null, 27 | vip_type: null, 28 | }, 29 | tableData: [] 30 | }; 31 | }, 32 | methods: { 33 | switch_bd_user(id, switchstate, index) { 34 | 35 | axios.post('/api.php/', 'type=switch_bd_user&id=' + id + '&switch=' + switchstate + '') 36 | .then(response => { 37 | if (response.data.success == true) { 38 | this.tableData[index]['switch'] = response.data.switch; 39 | this.$message({ 40 | message: response.data.message, 41 | type: 'success' 42 | }); 43 | } else { 44 | this.$message.error(response.data.message); 45 | } 46 | }) 47 | }, 48 | add() { 49 | if (this.add_user.getinfo == false) { 50 | return this.$message.error('获取信息后在进行添加操作'); 51 | } 52 | // 'type=add&cookie=' + this.add_user.cookie + '&name=' + this.add_user.name + '&vip_type=' + this.add_user.vip_type + '' 53 | axios.post('/api.php',{ 54 | type: 'add', 55 | cookie: this.add_user.cookie, 56 | name: this.add_user.name, 57 | vip_type: this.add_user.vip_type, 58 | } ) 59 | .then(response => { 60 | if (response.data.success == true) { 61 | this.add_user.getinfo = false; 62 | this.add_bd_user_dialog = false; 63 | this.bd_list(); 64 | this.$message({ 65 | message: response.data.message, 66 | type: 'success' 67 | }); 68 | } else { 69 | this.$message.error(response.data.message); 70 | } 71 | 72 | }) 73 | }, 74 | get_bd_info() { 75 | if (this.add_user.cookie == null) { 76 | return this.$message.error('啊啊啊,你提交了个寂寞'); 77 | } 78 | this.add_user.loading = true; 79 | // 'type=get_bd_info&cookie=' + this.add_user.cookie 80 | axios.post('/api.php', { 81 | type: 'get_bd_info', 82 | cookie: this.add_user.cookie, 83 | }) 84 | .then(response => { 85 | this.add_user.loading = false; 86 | if (response.data.success == true) { 87 | if (response.data.data.errno == -6) { 88 | return this.$message.error("你输入的cookie有问题,或账号有问题,无法正常获取。" + response.data.data.errmsg + ""); 89 | } 90 | this.add_user.getinfo = true; 91 | this.add_user.name = response.data.data.baidu_name; 92 | this.add_user.vip_type = this.viptypemap.get(response.data.data.vip_type); 93 | } else { 94 | this.$message.error(response.data.message); 95 | } 96 | }) 97 | .catch(error => { 98 | this.add_user.loading = false; 99 | this.$message.error('请求错误:', error); 100 | }); 101 | }, 102 | add_bd_user() { 103 | this.add_bd_user_dialog = !this.add_bd_user_dialog; 104 | }, 105 | revise_info() { 106 | // 'type=revise_info&title=' + this.config.title + '&AnnounceSwitch=' + this.config.AnnounceSwitch + '&Announce=' + this.config.Announce + '&user_agent=' + this.config.user_agent + '&cookie=' + this.config.cookie + '' 107 | axios.post('/api.php/', { 108 | type:'revise_info', 109 | title: this.config.title, 110 | AnnounceSwitch: this.config.AnnounceSwitch, 111 | Announce: this.config.Announce, 112 | user_agent: this.config.user_agent, 113 | cookie: this.config.cookie, 114 | }) 115 | .then(response => { 116 | if (response.data.success == true) { 117 | this.$message({ 118 | message: response.data.message, 119 | type: 'success' 120 | }); 121 | } else { 122 | this.$message.error(response.data.message); 123 | } 124 | }) 125 | }, 126 | 127 | delete_bd_user(index, row) { 128 | axios.post('/api.php/', 'type=delete_bd_user&id=' + this.tableData[index].id) 129 | .then(response => { 130 | if (response.data.success == true) { 131 | this.tableData.splice(index, 1); 132 | this.$message({ 133 | message: response.data.message, 134 | type: 'success' 135 | }); 136 | } else { 137 | this.$message.error(response.data.message); 138 | } 139 | }) 140 | .catch(error => { 141 | this.$message.error('请求错误:', error); 142 | }); 143 | }, 144 | bd_list() { 145 | axios.post('/api.php/', 'type=get_account_list') 146 | .then(response => { 147 | this.loading = false 148 | this.tableData = response.data.list 149 | }) 150 | .catch(error => { 151 | this.loading = false 152 | this.$message.error('请求错误:', error); 153 | }); 154 | } 155 | }, 156 | mounted() { 157 | axios.post('https://speed.uy5.net/', 'v=0.0.1') 158 | .then(response => { 159 | this.illustrate.message = response.data.content; 160 | }) 161 | .catch(error => { 162 | this.illustrate.message = '加载超时,获取信息失败'; 163 | }); 164 | this.bd_list() 165 | } 166 | 167 | } 168 | const app = Vue.createApp(App); 169 | app.use(ElementPlus); 170 | app.mount("#app"); -------------------------------------------------------------------------------- /admin/index.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | <?php echo $get_config['title'] ?> 后台控制中心 26 | 27 | 28 |
29 | 30 | 31 | 32 | 38 |

44 | 获取信息

45 |

46 | 47 | 55 |
56 | 57 | 58 | 59 | 60 | 61 |

后台控制中心

62 | 63 | 64 |



65 |



66 | 67 |

73 | 74 |

80 | 保存 81 |
82 | 83 | 添加代理账号

84 | 90 | 94 | 95 | 99 | 100 | 103 | 106 | 107 | 111 | 112 | 116 | 117 | 120 | 121 | 124 | 132 | 133 | 134 |
135 | 136 | 137 | 138 | 139 | 140 | 141 |
142 | 143 |
144 |
145 | 152 | 153 | 158 | 159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /admin/login.js: -------------------------------------------------------------------------------- 1 | const App = { 2 | data() { 3 | return { 4 | user: "", 5 | pass: "" 6 | } 7 | }, 8 | methods: { 9 | login() { 10 | axios.post('/api.php', 'type=login&user=' + this.user + '&pass=' + this.pass + '') 11 | .then(response => { 12 | if (response.data.success == true) { //数据库连接成功 13 | this.$message({ 14 | message: response.data.message, 15 | type: 'success' 16 | }); 17 | window.location.href = "./"; 18 | } else { //数据库连接失败 19 | this.$message.error(response.data.message); 20 | } 21 | }) 22 | } 23 | } 24 | 25 | } 26 | const app = Vue.createApp(App); 27 | app.use(ElementPlus); 28 | app.mount("#app"); -------------------------------------------------------------------------------- /admin/login.php: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | <?php echo $get_config['title'] ?> 登录面板 24 | 25 | 26 |
27 | 28 |

后台登录面板

29 |

30 |

31 | 登录后台 32 |
33 |
34 | 35 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /api.php: -------------------------------------------------------------------------------- 1 | 'get_account_list', 20 | 'delete_bd_user' => 'delete_bd_user', 21 | 'get_bd_info' => 'get_bd_info', 22 | 'add' => 'add', 23 | 'revise_info' => 'revise_info', 24 | 'switch_bd_user' => 'switch_bd_user', 25 | ]; 26 | $commonActions = [ 27 | 'createDatabase' => 'createDatabase', 28 | 'login' => 'login', 29 | 'get_list' => 'get_list', 30 | 'get_sign' => 'get_sign', 31 | 'down_file' => 'down_file' 32 | ]; 33 | if (file_exists(__DIR__ . "/config.php")) { 34 | if (if_login() && isset($adminActions[$type])) { 35 | $data = call_user_func($adminActions[$type]); 36 | echo $data; 37 | } 38 | } 39 | if (isset($commonActions[$type])) { 40 | $data = call_user_func($commonActions[$type]); 41 | echo $data; 42 | } 43 | 44 | ?> 45 | -------------------------------------------------------------------------------- /assets/images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehub666/94list/5831c8240e99a72b7d3508c79ef46ae4b96befe8/assets/images/1.png -------------------------------------------------------------------------------- /assets/images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehub666/94list/5831c8240e99a72b7d3508c79ef46ae4b96befe8/assets/images/2.png -------------------------------------------------------------------------------- /assets/images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehub666/94list/5831c8240e99a72b7d3508c79ef46ae4b96befe8/assets/images/3.png -------------------------------------------------------------------------------- /assets/images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehub666/94list/5831c8240e99a72b7d3508c79ef46ae4b96befe8/assets/images/5.png -------------------------------------------------------------------------------- /assets/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehub666/94list/5831c8240e99a72b7d3508c79ef46ae4b96befe8/assets/images/file.png -------------------------------------------------------------------------------- /assets/images/unknownfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehub666/94list/5831c8240e99a72b7d3508c79ef46ae4b96befe8/assets/images/unknownfile.png -------------------------------------------------------------------------------- /assets/js/index.js: -------------------------------------------------------------------------------- 1 | const App = { 2 | data() { 3 | return { 4 | taskurl: "", 5 | pass: "", 6 | taskstate: false, 7 | shorturl: null, 8 | user_agent: user_agent, 9 | list: [], 10 | rw_list: [], 11 | DownDialog: false, 12 | get_list_loading: false, 13 | Currentdirectory: "", 14 | pl_Currentdirectory: "", 15 | settingdialog: false, 16 | pathopen: true, 17 | selectdownlist: [], 18 | AnnounceSwitch: AnnounceSwitch, 19 | Announce: Announce, 20 | }; 21 | }, 22 | 23 | 24 | watch: { 25 | taskurl(newValue) { 26 | const regex = /pwd=([a-zA-Z0-9]{4})/; 27 | const match = newValue.match(regex); 28 | if (match && match[1]) { 29 | const password = match[1]; 30 | this.$message.success('检测链接存在密码,已为您自动输入') 31 | this.pass = password; 32 | } 33 | const regex2 = /提取码:\s?([a-zA-Z0-9_-]+)/; 34 | const match2 = newValue.match(regex2); 35 | if (match2 && match2[1]) { 36 | const password = match2[1]; 37 | this.$message.success('检测链接存在密码,已为您自动输入') 38 | this.pass = password; 39 | } 40 | }, 41 | DownDialog(newVal) { 42 | if (!newVal) { 43 | this.rw_list = []; 44 | } 45 | } 46 | }, 47 | methods: { 48 | copy(text, message) { 49 | var textarea = document.createElement("textarea"); 50 | textarea.value = text; 51 | document.body.appendChild(textarea); 52 | textarea.select(); 53 | document.execCommand("copy"); 54 | document.body.removeChild(textarea); 55 | 56 | if (message) { 57 | this.$message({ 58 | message: message, 59 | type: 'success' 60 | }); 61 | } 62 | }, 63 | senddown(url, filename, port) { 64 | console.log(url) 65 | console.log(filename) 66 | console.log(port) 67 | const jsonrpc = '2.0'; 68 | const id = 'YOUR_ID'; 69 | const method = 'aria2.addUri'; 70 | const params = [ 71 | [url], 72 | { 73 | 'out': filename, 74 | 'header': ['User-Agent:' + this.user_agent + ''] 75 | } 76 | ]; 77 | axios.post('http://localhost:' + port + '/jsonrpc', { 78 | jsonrpc, 79 | id, 80 | method, 81 | params 82 | }) 83 | .then(response => { 84 | this.$message.success('已把 ' + filename + ' 任务发送给下载器') 85 | }) 86 | .catch(error => { 87 | this.$message.error('发送失败,可能相对应的下载器没有启动') 88 | }); 89 | }, 90 | get_file(dir) { 91 | this.selectedValues = []; 92 | this.taskstate = true 93 | axios.post('/api.php', 'type=get_list&shorturl=' + this.shorturl + '&dir=' + dir + '&root=0&pwd=' + this.pass + '&page=1&num=1000&order=time') 94 | .then(response => { 95 | this.taskstate = false 96 | this.list = response.data.list 97 | }) 98 | }, 99 | down_file(fs_id, timestamp, uk, sign, randsk, shareid, server_filename, downpath) { 100 | this.DownDialog = true; 101 | var data = { 102 | fs_id: fs_id, 103 | name: server_filename, 104 | DownState: "1", 105 | dlink: "获取中", 106 | downpath: downpath, 107 | }; 108 | var addedIndex = this.rw_list.push(data) - 1; 109 | 110 | axios.post('/api.php', 'type=down_file&fs_id=' + fs_id + '&time=' + timestamp + '&uk=' + uk + '&sign=' + sign + '&randsk=' + randsk + '&share_id=' + shareid + '') 111 | .then(response => { 112 | if (response.data.success) { 113 | this.rw_list[addedIndex].dlink = response.data.data.dlink; 114 | this.rw_list[addedIndex].DownState = 0; 115 | 116 | } else { 117 | if (response.data.message == undefined) { 118 | response.data.message = "服务器请求失败。"; 119 | } 120 | this.$message.error("" + server_filename + " 获链失败。原因:" + response.data.message + ""); 121 | this.rw_list[addedIndex].dlink = response.data.message; 122 | } 123 | 124 | }) 125 | }, 126 | 127 | SelectedRows(row) { 128 | this.selectdownlist = row; 129 | }, 130 | pl_down() { 131 | this.$message('正在创建批量任务,稍等一下'); 132 | this.selectdownlist.forEach(row => { 133 | if (row.isdir == "1") { 134 | this.$message.error('文件夹下载暂时关闭,未获取 "' + row.server_filename + '" 文件夹内容'); 135 | } else { 136 | this.down_file(row.fs_id, this.timestamp, this.uk, this.sign, this.randsk, this.shareid, row.server_filename, ) 137 | } 138 | }); 139 | 140 | 141 | }, 142 | 143 | 144 | clickfile(scope) { 145 | if (scope.isdir == 1) { 146 | this.get_file(scope.path); 147 | } else { 148 | this.down_file(scope.fs_id, this.timestamp, this.uk, this.sign, this.randsk, this.shareid, scope.server_filename, ) 149 | } 150 | }, 151 | formatBytes(bytes, decimals = 2) { 152 | if (bytes === 0) return '0 Bytes'; 153 | 154 | const k = 1024; 155 | const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; 156 | 157 | const i = Math.floor(Math.log(bytes) / Math.log(k)); 158 | return parseFloat((bytes / Math.pow(k, i)) 159 | .toFixed(decimals)) + ' ' + sizes[i]; 160 | }, 161 | formatTimestamp(timestamp) { 162 | const date = new Date(timestamp * 1000); 163 | const options = { 164 | year: 'numeric', 165 | month: 'long', 166 | day: 'numeric', 167 | }; 168 | return date.toLocaleDateString(undefined, options); 169 | }, 170 | extractParam() { 171 | var regex = /s\/([a-zA-Z0-9_-]+)/; 172 | var match = this.taskurl.match(regex); 173 | if (match) { 174 | return match[1]; 175 | } else { 176 | regex = /surl=([a-zA-Z0-9_-]+)/; 177 | match = this.taskurl.match(regex); 178 | if (match) { 179 | return '1' + match[1] + ''; 180 | } else { 181 | return false 182 | } 183 | } 184 | }, 185 | analyze() { 186 | this.selectedValues = []; 187 | this.pl_Currentdirectory = ""; 188 | this.Currentdirectory = ""; 189 | this.taskstate = true 190 | this.shorturl = this.extractParam(); 191 | if (this.shorturl == false) { 192 | this.$message.error('链接错误,获取失败'); 193 | this.taskstate = false; 194 | return 195 | } 196 | axios.post('/api.php', 'type=get_list&shorturl=' + this.shorturl + '&dir=&root=0&pwd=' + this.pass + '&page=1&num=1000&order=time') 197 | .then(response => { 198 | if (response.data.success) { 199 | this.uk = response.data.data.uk 200 | this.shareid = response.data.data.shareid 201 | this.randsk = response.data.data.randsk 202 | this.list = response.data.list 203 | } else { 204 | this.$message.error(response.data.message); 205 | this.taskstate = false 206 | return 207 | } 208 | axios.post('/api.php', 'type=get_sign&shareid=' + this.shareid + '&uk=' + this.uk + '') 209 | .then(response => { 210 | if (response.data.success) { 211 | this.sign = response.data.data.data.sign 212 | this.timestamp = response.data.data.data.timestamp 213 | } else { 214 | this.$message.error(response.data.message); 215 | return 216 | } 217 | this.taskstate = false 218 | }) 219 | }) 220 | }, 221 | 222 | } 223 | 224 | } 225 | const app = Vue.createApp(App); 226 | app.use(ElementPlus); 227 | app.mount("#app"); 228 | -------------------------------------------------------------------------------- /function.php: -------------------------------------------------------------------------------- 1 | query($sql); 22 | $response = array(); 23 | $row = $result->fetch_assoc(); 24 | $connectDatabase->close(); 25 | return $row; 26 | } 27 | 28 | function gethead($url, $header) { 29 | $ch = curl_init($url); 30 | setCurl($ch, $header); 31 | curl_setopt_array($ch, [ 32 | CURLOPT_HEADER => true, 33 | CURLOPT_NOBODY => true, 34 | CURLOPT_FOLLOWLOCATION => false, 35 | ]); 36 | $response = curl_exec($ch); 37 | $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); 38 | curl_close($ch); 39 | return substr($response, 0, $headerSize); 40 | } 41 | 42 | function UseCookie(){ 43 | $sql = "SELECT * FROM `bd_user` WHERE (`state` = 0 OR `state` = -2) AND `switch` = 0 ORDER BY RAND() LIMIT 1;"; 44 | $connectDatabase = connectDatabase(); 45 | $result = $connectDatabase->query($sql); 46 | $response = array(); 47 | $row = $result->fetch_assoc(); 48 | $connectDatabase->close(); 49 | return $row; 50 | } 51 | 52 | function connectDatabase() { 53 | global $hostname, $username, $password, $database; 54 | $connection = mysqli_connect($hostname, $username, $password, $database); 55 | if (!$connection) { 56 | $response["success"] = false; 57 | $response["message"] = "连接数据库失败:" . mysqli_connect_error(); 58 | return json_encode($response); 59 | } else { 60 | return $connection; 61 | } 62 | } 63 | 64 | function if_login() { 65 | if (isset($_SESSION['user'])) { 66 | $user = $_SESSION['user']; 67 | $connectDatabase = connectDatabase(); 68 | $sql = "SELECT * FROM `admin` WHERE `user` LIKE '$user'"; 69 | $result = $connectDatabase->query($sql); 70 | if ($result->num_rows == 1) { 71 | return true; 72 | } 73 | $connectDatabase->close(); 74 | } 75 | return false; 76 | } 77 | 78 | function login() { 79 | $user = $_POST['user']; 80 | $pass = $_POST['pass']; 81 | $sql = "SELECT * FROM `admin` WHERE `user` = '$user'"; 82 | 83 | $connectDatabase = connectDatabase(); 84 | $result = $connectDatabase->query($sql); 85 | if($result){ 86 | if ($result->num_rows == 1) { 87 | $row = $result->fetch_assoc(); 88 | if ($pass == $row['pass']) { 89 | $_SESSION['user'] = $user; 90 | $response["success"] = true; 91 | $response["message"] = "登录成功,感谢使用"; 92 | } else { 93 | $response["success"] = false; 94 | $response["message"] = "密码错误"; 95 | } 96 | } else { 97 | $response["success"] = false; 98 | $response["message"] = "账号不存在"; 99 | } 100 | }else{ 101 | $response["success"] = false; 102 | $response["message"] = "查询失败,可能是数据库出现问题"; 103 | } 104 | 105 | $connectDatabase->close(); 106 | return json_encode($response); 107 | } 108 | 109 | function importSQLFile($connection) { 110 | $sqlFile = './install/install.sql'; 111 | $sql = file_get_contents($sqlFile); 112 | $sqlStatements = explode(';', $sql); 113 | 114 | foreach ($sqlStatements as $sqlStatement) { 115 | $sqlStatement = trim($sqlStatement); 116 | if (!empty($sqlStatement)) { 117 | if ($connection->query($sqlStatement) !== TRUE) { 118 | return false; 119 | } 120 | } 121 | } 122 | 123 | return true; 124 | } 125 | 126 | function delete_bd_user() { 127 | $id=$_POST['id']; 128 | $connectDatabase = connectDatabase(); 129 | $sql = "DELETE FROM bd_user WHERE `bd_user`.`id` = $id"; 130 | $result = $connectDatabase->query($sql); 131 | 132 | if ($result === true) { 133 | $response["success"] = true; 134 | $response["message"] ="账号数据删除成功"; 135 | } else { 136 | $response["success"] = false; 137 | $response["message"] ="删除失败,".$connectDatabase->error.""; 138 | } 139 | 140 | $connectDatabase->close(); 141 | return json_encode($response); 142 | } 143 | 144 | function get_account_list(){//输出账号列表 145 | $connectDatabase = connectDatabase(); 146 | // 执行查询 147 | $sql = "SELECT * FROM `bd_user` ORDER BY `bd_user`.`id` DESC"; 148 | $result = $connectDatabase->query($sql); 149 | 150 | if ($result) { 151 | $data = array(); 152 | 153 | while ($row = $result->fetch_assoc()) { 154 | $data[] = $row; 155 | } 156 | $response["success"] = true; 157 | $response["message"] ="列表渲染数据获取成功"; 158 | $response["list"] = $data; 159 | } else { 160 | $response["success"] = false; 161 | $response["message"] = "查询列表失败,".$connectDatabase->error.""; 162 | } 163 | 164 | $connectDatabase->close(); 165 | return json_encode($response); 166 | } 167 | 168 | function createDatabase() { 169 | if (!file_exists("./config.php")) { 170 | $response = array(); 171 | $hostname = $_POST["hostname"]; 172 | $username = $_POST["username"]; 173 | $password = $_POST["password"]; 174 | $database = $_POST["database"]; 175 | 176 | $connection = mysqli_connect($hostname, $username, $password, $database); 177 | 178 | if ($connection) { 179 | $configContent = ""; 185 | 186 | if (file_put_contents("./config.php", $configContent)) { 187 | if (importSQLFile($connection)) { 188 | $response["success"] = true; 189 | $response["message"] = "数据库连接并配置成功"; 190 | } else { 191 | $response["success"] = true; 192 | $response["message"] = "导入基础数据库失败,可能你这个数据库中已经有基础数据了,可无视这个报错"; 193 | } 194 | } else { 195 | $response["success"] = false; 196 | $response["message"] = "无权限配置数据库信息"; 197 | } 198 | 199 | $connection->close(); 200 | } else { 201 | $response["success"] = false; 202 | $response["message"] = "连接失败,请检查数据库信息"; 203 | } 204 | } else { 205 | $response["success"] = false; 206 | $response["message"] = "已经配置过数据库连接信息"; 207 | } 208 | 209 | return json_encode($response); 210 | } 211 | 212 | 213 | 214 | 215 | function setCurl($ch, array $header) { 216 | $options = array( 217 | CURLOPT_SSL_VERIFYPEER => false, 218 | CURLOPT_SSL_VERIFYHOST => 0, 219 | CURLOPT_RETURNTRANSFER => true, 220 | CURLOPT_HTTPHEADER => $header, 221 | CURLOPT_TIMEOUT => 8, 222 | ); 223 | 224 | curl_setopt_array($ch, $options); 225 | } 226 | 227 | function get(string $url, array $header) { 228 | $ch = curl_init($url); 229 | setCurl($ch, $header); 230 | $result = curl_exec($ch); 231 | curl_close($ch); 232 | return $result; 233 | } 234 | 235 | function post(string $url, $data, array $header) { 236 | $ch = curl_init($url); 237 | setCurl($ch, $header); 238 | 239 | curl_setopt($ch, CURLOPT_POST, true); 240 | curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 241 | 242 | $result = curl_exec($ch); 243 | curl_close($ch); 244 | 245 | return $result; 246 | } 247 | 248 | function get_bd_info() {//获取用户信息 249 | $cookie = $_POST['cookie']; 250 | $header = array( 251 | 'Cookie: ' . $cookie 252 | ); 253 | $result = get('https://pan.baidu.com/rest/2.0/xpan/nas?method=uinfo', $header); 254 | 255 | if ($result === false) { 256 | $response["success"] = false; 257 | $response["message"] = "后端通讯错误"; 258 | } else { 259 | $decodedResult = json_decode($result, true); 260 | if ($decodedResult !== null) { 261 | $response["success"] = true; 262 | $response["data"] = $decodedResult; 263 | } else { 264 | $response["success"] = false; 265 | $response["message"] = "JSON 解码错误"; 266 | } 267 | } 268 | 269 | return json_encode($response); 270 | } 271 | 272 | function revise_info(){ 273 | $connectDatabase = connectDatabase(); 274 | $title = $_POST['title']; 275 | $AnnounceSwitch = $_POST['AnnounceSwitch']; 276 | $AnnounceSwitch = ($AnnounceSwitch == "true") ? 1 : 0; 277 | $Announce = $_POST['Announce']; 278 | $user_agent = $_POST['user_agent']; 279 | $cookie = $_POST['cookie']; 280 | $sql = "UPDATE `config` SET `title` = '$title', `user_agent` = '$user_agent', `cookie` = '$cookie', `AnnounceSwitch` = '$AnnounceSwitch', `Announce` = '$Announce' WHERE `config`.`id` = 1;"; 281 | $result = $connectDatabase->query($sql); 282 | if ($result === true) { 283 | $response["success"] = true; 284 | $response["message"] = '修改基础信息成功'; 285 | } else { 286 | $response["success"] = false; 287 | $response["message"] = '修改基础信息失败'; 288 | } 289 | $connectDatabase->close(); 290 | return json_encode($response); 291 | } 292 | function switch_bd_user(){ 293 | $id=$_POST['id']; 294 | $switch=$_POST['switch']; 295 | $switch = ($switch === '-1') ? '0' : (($switch === '0') ? '-1' : $switch); 296 | $sql="UPDATE `bd_user` SET `switch` = '$switch' WHERE `bd_user`.`id` = $id;"; 297 | $connectDatabase = connectDatabase(); 298 | $result = $connectDatabase->query($sql); 299 | if ($result === true) { 300 | $response["success"] = true; 301 | $response["message"] ="更改状态成功"; 302 | $response["switch"]=$switch; 303 | } else { 304 | $response["success"] = false; 305 | $response["message"] ="更改状态失败,".$connectDatabase->error.""; 306 | } 307 | $connectDatabase->close(); 308 | return json_encode($response); 309 | } 310 | 311 | function add() { 312 | $cookie = $_POST['cookie']; 313 | $name = $_POST['name']; 314 | $vip_type = $_POST['vip_type']; 315 | $currentDateTime = date('Y-m-d H:i:s'); 316 | $sql = "INSERT INTO `bd_user` (`id`, `name`, `cookie`, `add_time`, `use`, `state`, `switch`, `vip_type`) 317 | VALUES (NULL, '$name', '$cookie', '$currentDateTime', '$currentDateTime', '-2', '0', '$vip_type');"; 318 | 319 | $connectDatabase = connectDatabase(); 320 | $result = $connectDatabase->query($sql); 321 | 322 | $response = [ 323 | "success" => false, 324 | "message" => "代理账号插入失败:" . $connectDatabase->error 325 | ]; 326 | 327 | if ($result) { 328 | $response["success"] = true; 329 | $response["message"] = "代理账号插入成功"; 330 | } 331 | 332 | return json_encode($response); 333 | } 334 | 335 | function get_sign() { 336 | $shareid = $_POST['shareid']; 337 | $uk = $_POST['uk']; 338 | $get_config = get_config(); 339 | $header = [ 340 | 'Cookie: ' . $get_config['cookie'] 341 | ]; 342 | 343 | $result = get('https://pan.baidu.com/share/tplconfig?shareid=' . $shareid . '&uk=' . $uk . '&fields=sign,timestamp&channel=chunlei&web=1&app_id=250528&clienttype=0', $header); 344 | $decodedResult = json_decode($result, true); 345 | $errno = $decodedResult["errno"]; 346 | 347 | $response = [ 348 | "success" => false, 349 | "message" => "未知错误代码:" . $errno 350 | ]; 351 | 352 | switch ($errno) { 353 | case '0': 354 | $response["success"] = true; 355 | $response["message"] = "取链信息值已经获取到位"; 356 | $response["data"] = $decodedResult; 357 | break; 358 | case '9019': 359 | $response["message"] = "错误代码:" . $errno . ",获取信息的代理账号有问题"; 360 | break; 361 | } 362 | 363 | return json_encode($response); 364 | } 365 | 366 | 367 | function BanCookie($id){//cookie失效,封禁一下 368 | $sql="UPDATE `bd_user` SET `state` = '-1' WHERE `bd_user`.`id` = $id;"; 369 | $connectDatabase = connectDatabase(); 370 | $connectDatabase->query($sql); 371 | $connectDatabase->close(); 372 | } 373 | 374 | function UpdateCookieTime($id){ 375 | $currentDateTime = date('Y-m-d H:i:s'); 376 | $sql="UPDATE `bd_user` SET `use` = '$currentDateTime', `state` = '0' WHERE `bd_user`.`id` = $id;"; 377 | $connectDatabase = connectDatabase(); 378 | $connectDatabase->query($sql); 379 | $connectDatabase->close(); 380 | } 381 | 382 | function extractStr($str, $left, $right) { 383 | $start = strpos($str, $left); 384 | 385 | if ($start !== false) { 386 | $end = strpos($str, $right, $start); 387 | 388 | if ($end !== false) { 389 | $start += strlen($left); 390 | $result = substr($str, $start, $end - $start); 391 | 392 | if ($left === "Location") { 393 | $result = substr($result, 10); 394 | } 395 | 396 | return $result; 397 | } 398 | } 399 | 400 | return ''; 401 | } 402 | 403 | function down_file(){ 404 | $fs_id=$_POST['fs_id']; 405 | $time=$_POST['time']; 406 | $uk=$_POST['uk']; 407 | $sign=$_POST['sign']; 408 | $randsk=$_POST['randsk']; 409 | $share_id=$_POST['share_id']; 410 | $get_config=get_config(); 411 | $UseCookie=UseCookie(); 412 | $cookie = isset($UseCookie['cookie']) ? $UseCookie['cookie'] : null; 413 | if($cookie==null){ 414 | $response["success"] = false; 415 | $response["message"] = "仓库已经没有可用的代理账号提供服务。"; 416 | return json_encode($response); 417 | } 418 | $user_agent=$get_config['user_agent']; 419 | $url = 'https://pan.baidu.com/api/sharedownload?channel=chunlei&clienttype=12&sign=' . $sign . '×tamp=' . $time . '&web=1'; 420 | $data = "encrypt=0" . "&extra=" . urlencode('{"sekey":"' . urldecode($randsk) . '"}') . "&fid_list=[$fs_id]" . "&primaryid=$share_id" . "&uk=$uk" . "&product=share&type=nolimit"; 421 | $header = array( 422 | "User-Agent:$user_agent", 423 | "Cookie:$cookie", 424 | "Referer: https://pan.baidu.com/disk/home", 425 | "Host: pan.baidu.com", 426 | ); 427 | $result=post($url, $data, $header); 428 | $decodedResult = json_decode($result, true); 429 | $errno=$decodedResult["errno"]; 430 | switch ($errno) { 431 | case '0': 432 | UpdateCookieTime($UseCookie['id']); 433 | $headerArray = array( 'User-Agent:'.$user_agent.'', 'Cookie:'.$cookie.'' ); 434 | $gethead=gethead($decodedResult["list"][0]['dlink'],$headerArray); 435 | $realLink = extractStr($gethead, "http://", "\r\n"); 436 | if($realLink==""){ 437 | $response["success"] = false; 438 | $response["message"] = "获取跳转链接出错"; 439 | }else{ 440 | $response["success"] = true; 441 | $response["message"] = "下载数据获取成功"; 442 | $response["data"]["user_agent"]=$user_agent; 443 | $response['data']['dlink']="https://$realLink"; 444 | $response["data"]["fs_id"]=$decodedResult["list"][0]['fs_id']; 445 | $response["data"]["md5"]=$decodedResult["list"][0]['md5']; 446 | } 447 | 448 | 449 | break; 450 | case '9019': 451 | case '8001': 452 | BanCookie($UseCookie['id']); 453 | $response["success"] = false; 454 | $response["message"] = "错误代码".$errno.",代理账号失效或者IP被封禁。"; 455 | break; 456 | case '110': 457 | $response["success"] = false; 458 | $response["message"] = "当前代理ip已被BAN,请通知一下管理。"; 459 | break; 460 | default: 461 | $response["success"] = false; 462 | $response["message"] = "未知错误代码:".$errno.""; 463 | break; 464 | } 465 | return json_encode($response); 466 | } 467 | 468 | 469 | function get_list() { 470 | $shorturl = $_POST['shorturl']; 471 | $dir = $_POST['dir']; 472 | $root = ($dir == '') ? 1 : 0; 473 | $pwd = $_POST['pwd']; 474 | $page = $_POST['page']; 475 | $num = $_POST['num']; 476 | $order = "time"; 477 | 478 | $data = 'shorturl=' . $shorturl . '&dir=' . $dir . '&root=' . $root . '=&pwd=' . $pwd . '&page=1&num=1000&order=time'; 479 | $get_config = get_config(); 480 | $header = array( 481 | 'Cookie: ' . $get_config['cookie'] 482 | ); 483 | $result = post("https://pan.baidu.com/share/wxlist?channel=weixin&version=2.2.2&clienttype=25&web=1&qq-pf-to=pcqq.c2c", $data, $header); 484 | 485 | $decodedResult = json_decode($result, true); 486 | $errno = $decodedResult["errno"]; 487 | 488 | $response = [ 489 | "success" => false, 490 | "message" => "未知错误代码:" . $errno 491 | ]; 492 | 493 | switch ($errno) { 494 | case '0': 495 | $response["success"] = true; 496 | $response["message"] = "列表数据获取成功"; 497 | $response["list"] = $decodedResult["data"]["list"]; 498 | $response["data"]["uk"] = $decodedResult["data"]["uk"]; 499 | $response["data"]["shareid"] = $decodedResult["data"]["shareid"]; 500 | $response["data"]["randsk"] = $decodedResult["data"]["seckey"]; 501 | break; 502 | case '9019': 503 | $response["message"] = "通知一下管理员获取列表的代理账号出现问题"; 504 | break; 505 | case '-130': 506 | $response["message"] = "错误 " . $errno . ",可能你这个链接已经失效或者无法访问"; 507 | break; 508 | } 509 | 510 | return json_encode($response); 511 | } 512 | 513 | ?> -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | <?php echo $get_config['title'] ?> 用户操作演示面板 11 | 12 | 13 | 14 |
15 | 20 | {{Announce}} 21 | 22 | 23 | 当前的UA : {{ user_agent }}

24 | 25 | 26 | 27 | 30 | 31 | 32 | 43 | 44 | 45 |
46 | 47 | 48 | 53 |

54 |

55 | 56 | 解析链接 57 | 批量下载 58 | 59 |


60 | 61 | 69 | 72 | 73 | 76 | 85 | 86 | 89 | 92 | 93 | 95 | 98 | 99 | 100 | 101 |
102 | 107 | -------------------------------------------------------------------------------- /install/index.php: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 就是加速 网页端部署安装 15 | 16 | 17 |
18 | 19 | 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 | 后台管理 默认账号:admin,密码 :admin 63 |

64 | 前往 65 |
66 | '; 67 | } else { 68 | echo'

你已配置过数据库,如需要重新配置可把根目录config.php文件删除重新刷新本页面。

'; 69 | } 70 | ?> 71 |
72 |
73 | 145 | 150 | 151 | -------------------------------------------------------------------------------- /install/install.sql: -------------------------------------------------------------------------------- 1 | 2 | 3 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 4 | START TRANSACTION; 5 | SET time_zone = "+00:00"; 6 | 7 | CREATE TABLE `admin` ( 8 | `id` int(11) NOT NULL, 9 | `user` text NOT NULL, 10 | `pass` text NOT NULL, 11 | `permissions` int(11) NOT NULL COMMENT '1是管理员' 12 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 13 | 14 | 15 | 16 | INSERT INTO `admin` (`id`, `user`, `pass`, `permissions`) VALUES 17 | (1, 'admin', 'admin', 1); 18 | 19 | 20 | 21 | CREATE TABLE `bd_user` ( 22 | `id` int(11) NOT NULL, 23 | `name` text NOT NULL COMMENT '名称', 24 | `cookie` text NOT NULL COMMENT '身份值', 25 | `add_time` datetime NOT NULL COMMENT '添加时间', 26 | `use` datetime NOT NULL COMMENT '时间表示最后一次使用日期', 27 | `state` tinyint(4) NOT NULL COMMENT '状态 0能用,-1死亡,-2是待测试', 28 | `switch` tinyint(11) NOT NULL COMMENT '开关 0开 -1关', 29 | `vip_type` text NOT NULL 30 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 31 | 32 | 33 | 34 | CREATE TABLE `config` ( 35 | `id` int(11) NOT NULL, 36 | `title` text NOT NULL, 37 | `user_agent` text NOT NULL, 38 | `cookie` text NOT NULL COMMENT '获取列表的cookie', 39 | `AnnounceSwitch` tinyint(1) NOT NULL COMMENT '公告开关,1开0关', 40 | `Announce` text NOT NULL 41 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 42 | 43 | 44 | INSERT INTO `config` (`id`, `title`, `user_agent`, `cookie`, `AnnounceSwitch`, `Announce`) VALUES 45 | (1, '就是加速', 'netpan', '', 1, '就是加速'); 46 | 47 | ALTER TABLE `admin` 48 | ADD PRIMARY KEY (`id`); 49 | 50 | 51 | ALTER TABLE `bd_user` 52 | ADD PRIMARY KEY (`id`); 53 | 54 | ALTER TABLE `config` 55 | ADD PRIMARY KEY (`id`); 56 | 57 | 58 | ALTER TABLE `admin` 59 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; 60 | 61 | 62 | ALTER TABLE `bd_user` 63 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45; 64 | 65 | -- 66 | -- 使用表AUTO_INCREMENT `config` 67 | -- 68 | ALTER TABLE `config` 69 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; 70 | COMMIT; 71 | --------------------------------------------------------------------------------