短剧API接口

Relax 914 0

最近发现短剧需求挺大,搭建了短剧站并且抓到了接口,大家可以自行调成想要的返回格式
云端同步 https://ys.110t.cn/api/ajax.php?act=yingshilist
影视搜索 https://ys.110t.cn/api/ajax.php?act=search&name=剧名
每日更新 https://ys.110t.cn/api/ajax.php?act=Daily

<?php
header("Access-Control-Allow-Origin: *"); // 允许跨域请求

if(isset($_GET['act'])) {
$act = $_GET['act'];

if($act == 'yingshilist') {
$url = 'http://www.v60s.top/tvapi?act=yingshilist';
} elseif($act == 'search') {
if(isset($_GET['name'])) {
$name = urlencode($_GET['name']);
$url = 'http://www.v60s.top/tvapi?act=search&name=' . $name;
} else {
echo 'Error: Missing parameter "name"';
exit();
}
} elseif($act == 'Daily') {
$url = 'http://www.v60s.top/tvapi?act=Daily';
} else {
echo 'Error: Invalid action';
exit();
}

// 使用cURL库发送GET请求
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);

// 输出获取到的数据
echo $data;
} else {
echo '请检查字段"';
}
?>

发表评论 取消回复

表情 图片 链接 代码

分享