<?php
// 携带的参数
$platform = 2;
$deviceid = "0010D49CFACA97013511BCCCE05941C7";
$version = "2.2.1";
$siteid = 475;
$host = "www.jxxw.com.cn";
$connection = "Keep-Alive";
$acceptEncoding = "gzip";
$userAgent = "okhttp/4.10.0";
$ifModifiedSince = "Mon, 20 Nov 2023 09:29:24 GMT";
// 构建参数字符串
$params = http_build_query([
'platform' => $platform,
'deviceid' => $deviceid,
'version' => $version,
'siteid' => $siteid,
]);
// 构建完整的URL
$url = "http://www.jxxw.com.cn/smapp/media/getLiveChannelNewList?" . $params;
// 构建HTTP头部信息
$headers = [
'Host: ' . $host,
'Connection: ' . $connection,
'Accept-Encoding: ' . $acceptEncoding,
'User-Agent: ' . $userAgent,
'If-Modified-Since: ' . $ifModifiedSince,
];
// 初始化cURL会话
$ch = curl_init();
// 设置cURL选项
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// 执行cURL会话并获取结果
$response = curl_exec($ch);
// 关闭cURL会话
curl_close($ch);
// 输出结果
/*$json = json_decode($response,true);
$liveurl = $json["data"][0]["live_url"];
//header('location:'.$liveurl);
echo $liveurl;
exit;
*/
echo $response;
?>