随机视频API
首先打开服务器创建一个html文件也可以不创建
代码如下
点击查看代码
小姐姐在线随机播放
接下来我们给html创建一个简单的css美化
代码如下
点击查看代码
* {
border: 0;
margin: 0;
padding: 0;
outline: none;
box-sizing: border-box;
}
body {
background: #000;
width: 100vw;
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
}
#main {
height: calc(100vh - 60px);
display: flex;
justify-content: center;
align-items: center;
}
#player {
width: 100%;
height: auto;
max-height: 100%;
}
#buttons {
height: 60px;
padding: 10px;
}
#switch,
#next {
background: #FFF;
background: linear-gradient(to bottom, #FF2,#FB0);
color: #AF2E08;
font-size: 16px;
font-weight: bold;
height: 40px;
padding: 0px 20px;
margin: 0px 5px;
border-radius: 20px;
}
随后添加API如下
点击查看代码
<?php
function read(...$filelist) {
$list = [];
foreach ($filelist as $file) {
$handle = fopen($file, 'r');
while (($line = fgets($handle)) !== false) {
array_push($list, trim($line));
}
fclose($handle);
}
return $list;
}
$list = read('ks.txt');
$url = $list[array_rand($list)];
header("Location: {$url}");
接下来就是最简单的创建一个txt文件将你想要展示的链接粘贴进去即可
这里我提供一些
点击查看
https://dwz.mk/FvQVNb
https://dwz.mk/Q3YBjm
https://dwz.mk/MVZVjy
http://b6i.cn/6yHq3
http://mtw.so/66fctR
http://mtw.so/6d5rQ6
http://mtw.so/6llOO4
http://mtw.so/5JKMrO
http://mtw.so/66faVz
http://mtw.so/6llPR4
http://mtw.so/6sS2VL
http://mtw.so/5YNa04
http://mtw.so/6llPRe
http://mtw.so/5Ceznr
http://mtw.so/6d5qi8
http://mtw.so/5uImiU
http://mtw.so/6d5qii
http://mtw.so/5JKMu4
http://mtw.so/6llPRI
http://mtw.so/5uImkQ
http://mtw.so/5YNa2k
http://mtw.so/6llPRS
http://mtw.so/5JKMuo
http://mtw.so/6d5qiM
http://mtw.so/6llPS2
http://mtw.so/5JKMuy
http://mtw.so/5YNa2E