|
发表于 2025-9-2 10:39:28
|
显示全部楼层
<?php
//https://summer.bestv.cn/smg_gongzhonghao_h5/#/home
$id = $_GET['id'];
//$id = 22;
$u = 'https://bp-api.bestv.cn/cms/api/live/channels';
$c = file_get_contents($u, false, stream_context_create(array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
),
'http' => array(
'method' => 'POST',
'header' =>
"Content-Type: application/json\r\n",
// "token: \r\n".
// "userId:\r\n",
'content' => '{}'
)
)));
$j = json_decode($c);
$dt = $j->dt;
foreach ($dt as $i) {
if ($i->id == $id)
{
$p = $i->channelUrl;
break;
}
}
if (!isset($p))
die('not found');
header('Access-Control-Allow-Origin: *');
header('Location: ' . $p); |
|