API视频爬虫示例
<?php
// 请求参数
$params = array(
'type' => 'json'
);
// 请求次数
$requestCount = 100;
for ($i = 1; $i <= $requestCount; $i++) {
// 构建请求 URL
$url = 'http://api.yujn.cn/api/rewu.php?' . http_build_query($params);
// 发送 GET 请求
$response = file_get_contents($url);
// 如果请求成功,将 JSON 响应追加到文件
if ($response !== false) {
$jsonFile = fopen('video.json', 'a'); // 使用 'a' 模式追加到文件
if ($jsonFile) {
fwrite($jsonFile, $response . "\n"); // 追加新的链接,并添加换行符
fclose($jsonFile);
} else {
echo '无法打开文件 video.json 来追加 JSON 响应。';
}
} else {
echo '无法获取 JSON 响应。';
}
}
echo '完成';
?>
小哥哥随机代码(AI写,不完善)
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="referrer" content="never">
<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>xiaogege</title>
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center; /* 垂直居中 */
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
#main {
text-align: center;
}
#player {
width: 70%; /* 修改视频宽度 */
height: auto;
}
#buttons {
display: flex;
align-items: center;
margin-top: 10px; /* 添加上方间距 */
}
button {
margin: 0 10px; /* 左右间距为10px */
font-size: 16px;
}
</style>
</head>
<body>
<section id="main">
<video id="player" src="" controls webkit-playsinline playsinline></video>
</section>
<section id="buttons">
<button id="switch">GO:kai</button>
<button id="next">NEXT</button>
<button id="return"><a href="https://kejilvyou.top/" target="_blank">DH</a></button>
</section>
<script>
(function (window, document) {
if (top != self) {
window.top.location.replace(self.location.href);
}
var get = function (id) {
return document.getElementById(id);
}
var bind = function (element, event, callback) {
return element.addEventListener(event, callback);
}
var auto = true;
var player = get('player');
var randomm = function () {
player.src = 'http://www.yujn.cn/api/xgg.php';
player.play();
}
bind(get('next'), 'click', randomm);
bind(player, 'error', function () {
randomm();
});
bind(get('switch'), 'click', function () {
auto = !auto;
this.innerText = 'guan:' + (auto ? 'kai' : '关');
});
bind(player, 'ended', function () {
if (auto) randomm();
});
})(window, document);
</script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>
------本页内容已结束,喜欢请分享------
感谢您的来访,获取更多精彩文章请收藏本站。
欢迎观看小姐姐视频
无法播放的视频,就一直点击下一位
天天看美女,强身又健体。
美女伴左右,健康又长寿。