江西赣橙TV
<?php$channelMap = [
'cctv1' => 'G_CCTV-1-HQ',
'cctv2' => 'G_CCTV-2-HQ',
'cctv3' => 'G_CCTV-3-HQ',
'cctv4' => 'G_CCTV-4-HQ',
'cctv5' => 'G_CCTV-5-HQ',
'cctv6' => 'G_CCTV-6-HQ',
'cctv8' => 'G_CCTV-8-HQ',
'cctv9' => 'G_CCTV-9-HQ',
'cctv10' => 'G_CCTV-10-HQ',
'cctv11' => 'G_CCTV-11-HQ',
'cctv12' => 'G_CCTV-12-HQ',
'cctv13' => 'G_CCTV-13-HQ',
'cctv14' => 'G_CCTV-14-HQ',
'cctv15' => 'G_CCTV-15',
'cetv1' => 'G_CETV-1-HQ',
'cetv4' => 'G_CETV-4-HQ',
'bjws' => 'G_BEIJING-HQ',
'dfws' => 'G_DONGFANG-HQ',
'tjws' => 'G_TIANJIN-HQ',
'cqws' => 'G_CHONGQING-HQ',
'hljws' => 'G_HEILONGJIANG-HQ',
'jlws' => 'G_JILIN-HQ',
'lnws' => 'G_LIAONING-HQ',
'nmws' => 'G_NEIMENGGU',
'nxws' => 'G_NINGXIA',
'gsws' => 'G_GANSU',
'qhws' => 'G_QINGHAI',
'sxws' => 'G_SHANXI',
'hbws' => 'G_HEBEI-HQ',
'sxiws' => 'SXWS',
'sdws' => 'G_SHANDONG-HQ',
'ahws' => 'G_ANHUI-HQ',
'hnws' => 'G_HENAN-HQ',
'hubws' => 'G_HUBEI-HQ',
'hunws' => 'G_HUNAN-HQ',
'jxws' => 'G_JIANGXI-HQ',
'jsws' => 'G_JIANGSU-HQ',
'zjws' => 'G_ZHEJIANG-HQ',
'dnws' => 'G_DONGNAN-HQ',
'gdws' => 'G_GUANGDONG-HQ',
'szws' => 'G_SHENZHEN-HQ',
'gxws' => 'G_GUANGXI-HQ',
'ynws' => 'G_YUNNAN',
'gzws' => 'G_GUIZHOU-HQ',
'scws' => 'G_SICHUAN-HQ',
'xjws' => 'G_XINJIANG',
'btws' => 'G_BINGTUAN',
'xzws' => 'G_XIZANG',
'hinws' => 'G_HAINAN-HQ',
'xdkt' => 'G_XUANDONG',
'jyjs' => 'G_JINYINGJS-HQ',
'jykt' => 'G_JINYING',
'jxds' => 'G_JXDS',
'jxjs' => 'G_JXJJSH',
'jxys' => 'G_JXYSLY',
'jxgg' => 'G_JXGGNY',
'jxse' => 'G_JXSE',
'jxxw' => 'G_JXXW',
'fsgw' => 'G_FENGSHANG',
'jxjy' => 'G_JXJY',
];
function main($id, $channelMap) {
if (empty($id) || !isset($channelMap[$id])) {
return false;
}
$realId = $channelMap[$id];
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_URL, 'https://jscn-auth-user.live.gitv.tv/v1/getAppToken');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'checksum: e4b13e6cb63bf456e4f42e44c238f01a'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"partnerCode":"JSCN","timestamp":"1710725285"}');
$tokenRes = curl_exec($ch);
if (empty($tokenRes)) {
curl_close($ch);
return '';
}
$tokenData = json_decode($tokenRes, true);
$token = $tokenData['data']['token'] ?? '';
if (empty($token)) {
curl_close($ch);
return '';
}
curl_setopt($ch, CURLOPT_URL, 'https://jxcbn.live.gitv.tv/gitv_live/' . $realId . '/' . $realId . '.m3u8?partnerCode=JXCN&gAppChannel=XIAOMI&gMac=02:00:00:00:00:00&token=' . urlencode($token));
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, []);
curl_setopt($ch, CURLOPT_POSTFIELDS, null);
$playUrlRes = curl_exec($ch);
curl_close($ch);
if (empty($playUrlRes)) {
return '';
}
$playData = json_decode($playUrlRes, true);
return $playData['data']['playinfo']['playurl'] ?? '';
}
$channelId = $_GET['id'] ?? '';
if (empty($channelId) || !isset($channelMap[$channelId])) {
http_response_code(403);
exit;
}
$playUrl = main($channelId, $channelMap);
if (!empty($playUrl)) {
header('Location: ' . $playUrl);
} else {
http_response_code(404);
}
页:
[1]