|
- <?php
- error_reporting(0);
- $id = $_GET['id']??'cctv6';
- $n = [
- 'cctv6' => 'C8000000000000000001703664302519',//CCTV6电影
- //以下频道需登录https://h5.nty.tv189.com/cgq/login/account抓取"c_t_id=xxxx"
- 'scws' => 'C8000000000000000001548997408538',//四川卫视
- 'gdws' => 'C8000000000000000001384940178600',//广东卫视
- 'henws' => 'C8000000000000000001698916303269',//河南卫视
- 'cqws' => 'C8000000000000000001549082026989',//重庆卫视
- 'lnws' => 'C8000000000000000001548311404330',//辽宁卫视
- 'jxws' => 'C8000000000000000001549003036408',//江西卫视
- 'sxiws' => 'C8000000000000000001549002827823',//山西卫视
- 'sxws' => 'C8000000000000000001549002795141',//陕西卫视
- 'jlws' => 'C8000000000000000001549002603906',//吉林卫视
- 'hbws' => 'C8000000000000000001631586047661',//湖北卫视
- 'dnws' => 'C8000000000000000001548999360374',//东南卫视
- 'gzws' => 'C8000000000000000001549002153536',//贵州卫视
- 'gxws' => 'C8000000000000000001549002105520',//广西卫视
- 'ynws' => 'C8000000000000000001549002977767',//云南卫视
- 'gsws' => 'C8000000000000000001548999871513',//甘肃卫视
- 'nmws' => 'C8000000000000000001549002645323',//内蒙古卫视
- 'btws' => 'C8000000000000000001698916970405',//兵团卫视
- 'qhws' => 'C8000000000000000001549002933424',//青海卫视
- 'xjws' => 'C8000000000000000001549002915776',//新疆卫视
- 'xzws' => 'C8000000000000000001549003208092',//西藏卫视
- 'nxws' => 'C8000000000000000001549002755065',//宁夏卫视
- 'hanws' => 'C8000000000000000001698917316657',//海南卫视
- 'cetv1' => 'C8000000000000000001685674939564',//CETV1
- 'cetv2' => 'C8000000000000000001685675010193',//CETV2
- 'cetv4' => 'C8000000000000000001685675077817',//CETV4
- 'zgjt' => 'C8000000000000000001685582159524',//中国交通
- 'hzsh' => 'C8000000000000000001679360839297',//杭州生活
- ];
- $url = "https://h5.nty.tv189.com/bff/apis/content/authPlayLive?cltrid=b56aba87-5a6b-4b1e-befd-e730f7cac97d&contentId={$n[$id]}&startTime=2025-03-26+12:05:00&endTime=2025-03-26+12:55:00&cltts=20250326122404&cltkey=d9dfdc66f779c53c26cdbe0e9068e234";
- //$url = "https://h5.nty.tv189.com/bff/apis/user/authPlayLive?contentId={$n[$id]}";
- $Cookie = "78978979897";//cctv6不用此值。
- //eb7c58af3dc221296f92705db9cabbcf需登录https://h5.nty.tv189.com/cgq/login/account抓取
- $h = [
- "Cookie:$Cookie",
- "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
- ];
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_HTTPHEADER,$h);
- $d = curl_exec($ch);
- curl_close($ch);
- $playUrl = json_decode($d)->info->playUrl;
- //可直接header('location:'.$playUrl);我嫌尾巴太长,作了以下变通,除去一些不必要参数:
- $uas = parse_url($playUrl)["query"];
- parse_str($uas,$arr);
- $playurl = "https://live1.nty.tv189.com/tm-dxcctv6-4000k.m3u8?sign={$arr['sign']}&time={$arr['time']}&t={$arr['t']}&guid={$arr['guid']}";
- header('location:'.$playurl);
- //print_r($playurl);
- ?>
复制代码
|
|