<?php
$timestamp = time() * 1000;
$api_url = "https://lwyd.xichongtv.cn//a/appLive/info/35137_b14710553f9b43349f46d33cc2b7fcfd?areaId=907&deviceVersionType=h5&vt=$timestamp";
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_REFERER, 'https://www.xichongtv.cn/');
$ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36';
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
$response = curl_exec($ch);
curl_close($ch);
if ($response) {
$data = json_decode($response, true);
if ($data && isset($data['data']['m3u8Url'])) {
$m3u8_url = $data['data']['m3u8Url'];
header("Location: $m3u8_url");
exit;
} elseif ($data && isset($data['m3u8Url'])) {
$m3u8_url = $data['m3u8Url'];
header("Location: $m3u8_url");
exit;
}
}
echo "Failed to get m3u8 url";
?>
|