重庆电视台php

重庆卫视,id=2
重庆新闻,id=3
<-?php
$t=date('YmdHi');
$type=isset($_GET['type'])?$_GET['type']:'hls';
$id=isset($_GET['id'])?$_GET['id']:'2';
$u="https://sjlivecdn9.cbg.cn/".$t."/app_2/_definst_/ls_".$id.".stream/";

if($type=='key'){

$d = k('https://sjlivecdnx.cbg.cn/1ive/stream_'.$id.'.php','https://www.cbg.cn/');

}else if($type=='hls'){

//header("Content-type: application/x-mpegURL");
$m3u8=m3u8($u.'chunklist.m3u8');
getPHPm3u($m3u8,$u,$id);

}

function m3u8($url){

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec($ch);
curl_close($ch);
return $result;

}
function getPHPm3u($_m3u8, $_u, $_id)
{

$phpself = substr($_SERVER['PHP_SELF'], strripos($_SERVER['PHP_SELF'], "/") + 1);
$_m3u8=preg_replace('/URI="(.*?)"/','URI="'.$phpself.'?type=key&id='.$_id.'"',$_m3u8);
if (strpos($_m3u8, '.ts')) {
    preg_match_all("/\n(.*?).ts/", $_m3u8, $a);
    for ($i = 0; $i < count($a[0]); $i++) {
        $_m3u8 = str_replace($a[0][$i], "\n" . $_u . $a[1][$i] . '.ts', $_m3u8);
    }
    echo $_m3u8;
}

}
function k($url,$ref){

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
//curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_REFERER, $ref);
$result = curl_exec($ch);
curl_close($ch);

}
?->
注:由于重庆台直播源m3u8里的key文件是带有Referer验证的,故本人已在此php加上key文件带Referer验证转发的代码,故在播放器里播放完全无需另加Referer。

触电新闻代理源码

<-?php

//触电新闻v3
$pk = $_GET['pk'];
$ts = time().'123';
$headers = [
    "X-ITOUCHTV-Ca-Key:04039368653554864194910691389924",
    "X-ITOUCHTV-Ca-Timestamp:$ts"
];
$signkey = "qmiHeB9bKgowHqxRv0prc2cPN2EwXL1HOYu3DPiYCcaYxyxdFIyT5mAfBmr0UKPO";
$bstrURL = "https://tcdn-api.itouchtv.cn/getParam";
$sign =base64_encode(hash_hmac("SHA256","GET\n$bstrURL\n$ts\n",$signkey,true));
$headers[] = "X-ITOUCHTV-Ca-Signature:$sign";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $bstrURL);                  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
$data = curl_exec($ch);
curl_close($ch);
$json = json_decode($data);
$node = $json->node;

array_pop($headers);
$bstrURL = "https://api.itouchtv.cn/liveservice/v3/tvChannelList?node=$node";
$sign = base64_encode(hash_hmac("SHA256","GET\n$bstrURL\n$ts\n",$signkey,true));
$headers[] = "X-ITOUCHTV-Ca-Signature:$sign";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $bstrURL);                  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
$data = curl_exec($ch);
curl_close($ch);

if($pk == '')
{
    $json = json_decode($data);
    foreach($json->tvChannelList as $out)
    {
        echo ($out->name.','.$out->pk.'<br />');
    }
}
else
{
    preg_match('/pk":'.$pk.',.*?"url":"(.*?)"/i',$data,$result);
    $playURL = $result[1];
    header("location:$playURL");
}

?->
No:0 pk:1183 name:广东珠江
No:1 pk:1182 name:广东卫视
No:2 pk:1197 name:南方卫视
No:3 pk:1198 name:广东综艺
No:4 pk:1186 name:广东新闻
No:5 pk:1184 name:广东体育
No:6 pk:1185 name:广东公共
No:7 pk:1199 name:广东影视
No:8 pk:1187 name:嘉佳卡通
No:9 pk:1191 name:广东国际
No:10 pk:1196 name:广东经济科教
No:11 pk:1200 name:广东少儿
No:12 pk:2463 name:广东移动
No:13 pk:2511 name:GRTN文化频道
No:14 pk:1232 name:肇庆新闻综合
No:15 pk:2402 name:河源综合
No:16 pk:1254 name:揭阳综合
No:17 pk:1248 name:江门综合
No:18 pk:1225 name:湛江综合
No:19 pk:2395 name:东莞新闻综合
No:20 pk:2396 name:惠州新闻综合
No:21 pk:2397 name:珠海综合
No:22 pk:2401 name:梅州综合
No:23 pk:2389 name:云浮综合
No:24 pk:1247 name:茂名综合
No:25 pk:1261 name:汕尾综合
No:26 pk:2386 name:韶关新闻综合
No:27 pk:1206 name:深圳卫视
No:28 pk:2496 name:河源公共
No:29 pk:1235 name:东莞公共
No:30 pk:2400 name:清远综合
No:31 pk:2506 name:阳江-2
No:32 pk:2505 name:阳江-1
No:33 pk:2398 name:汕头新闻综合
No:34 pk:2406 name:开平生活
No:35 pk:2452 name:紫金台
No:36 pk:2413 name:海丰县广播电视台
No:37 pk:2460 name:佛冈综合
No:38 pk:2447 name:英德新闻综合频道
No:39 pk:2458 name:阳春综合
No:40 pk:2414 name:广宁综合
No:41 pk:2404 name:惠东综合频道
No:42 pk:2405 name:开平综合
No:43 pk:2439 name:工布江达县广播电视台
No:44 pk:2445 name:廉江台
No:45 pk:2465 name:陆河县广播电视台
No:46 pk:2450 name:普宁台
No:47 pk:2448 name:清新综合频道
No:48 pk:2455 name:连州综合
No:49 pk:2441 name:鹤山综合
No:50 pk:2471 name:信宜台1
No:51 pk:2469 name:乳源电视台
No:52 pk:2440 name:化州综合
No:53 pk:2470 name:惠阳电视台
No:54 pk:2462 name:怀集综合
No:55 pk:2474 name:徐闻台
No:56 pk:2482 name:雷州综合
No:57 pk:2488 name:遂溪台
No:58 pk:2477 name:阳西公共
No:59 pk:2476 name:阳西综合
No:60 pk:2479 name:台山台
No:61 pk:2497 name:东源频道
No:62 pk:2490 name:新会综合
No:63 pk:2503 name:乐昌电视台
No:64 pk:2492 name:和平台
No:65 pk:2432 name:哈密一套
No:66 pk:2433 name:哈密二套
No:67 pk:2512 name:广东新闻广播
No:68 pk:2434 name:哈密三套
No:69 pk:2513 name:珠江经济
No:70 pk:2514 name:音乐之声
No:71 pk:2515 name:交通之声
No:72 pk:2518 name:南方生活
No:73 pk:2519 name:城市之声
No:74 pk:2516 name:股市广播
No:75 pk:2517 name:文体广播
No:76 pk:2467 name:高要电台
No:77 pk:2478 name:惠阳电台
No:78 pk:2464 name:海丰电台
No:79 pk:2461 name:佛冈电台
No:80 pk:2446 name:英德电台
No:81 pk:2430 name:广宁电台
No:82 pk:2410 name:四会电台
No:83 pk:2407 name:开平电台
No:84 pk:2457 name:连州电台
No:85 pk:2443 name:惠东电台
No:86 pk:2412 name:高州电台
No:87 pk:2411 name:廉江电台
No:88 pk:2459 name:阳春电台
No:89 pk:2466 name:螺河之声
No:90 pk:2442 name:鹤山电台
No:91 pk:2473 name:信宜电台
No:92 pk:2475 name:徐闻电台
No:93 pk:2483 name:雷州电台
No:94 pk:2484 name:新兴电台
No:95 pk:2487 name:遂溪电台
No:96 pk:2480 name:台山电台
No:97 pk:2486 name:怀集电台
No:98 pk:2481 name:恩平电台
No:99 pk:2489 name:新会电台
No:100 pk:2501 name:普宁电台
No:101 pk:2504 name:乐昌电台
No:102 pk:2498 name:东源电台
No:103 pk:2493 name:和平电台
No:104 pk:2508 name:阳江综合广播
No:105 pk:2507 name:阳江旅游环保广播
No:106 pk:2435 name:平谷电台
No:107 pk:2521 name:博罗people广播电台
No:108 pk:2491 name:罗定综合
No:109 pk:2520 name:连平台

某咕php

<-?php
$id = isset($_GET['id'])?$_GET['id']:'cctv1';
$n = array(
'cctv1' => '608807420',
'cctv2' => '631780532',
'cctv3' => '624878271',
'cctv4' => '631780421',
'cctv4a' => '608807416',
'cctv4o' => '608807419',
'cctv5' => '641886683',
'cctv5p' => '641886773',
'cctv6' => '624878396',
'cctv7' => '673168121',
'cctv8' => '624878356',
'cctv9' => '673168140',
'cctv10' => '624878405',
'cctv11' => '667987558',
'cctv12' => '673168185',
'cctv13' => '608807423',
'cctv14' => '624878440',
'cctv15' => '673168223',
'cctv16' => '722193822',
'cctv17' => '673168256',

'fxzl' => '624878970',
'zxs' => '708869532',

'cgtn' => '609017205', //CGTN
'cgtnjl' => '609006487', //CGTN纪录
'cgtna' => '609154345', //CGTN阿拉伯语
'cgtnf' => '609006476', //CGTN法语
'cgtne' => '609006450', //CGTN西班牙语
'cgtnr' => '609006446', //CGTN俄语

'hljws' => '630287540', //黑龙江卫视
'jlws' => '630288397', //吉林卫视
'lnws' => '630291707', //辽宁卫视高清
'qhws' => '630287272', //青海卫视
'hubws' => '630292423', //湖北卫视高清
'jxws' => '630290852', //江西卫视高清
'jsws' => '623899368', //江苏卫视高清
'gdws' => '608831231', //广东卫视高清
'nfws' => '608917627', //南方卫视
'gxws' => '634055160', //广西卫视
'ynws' => '630291417', //云南卫视
'gzws' => '631094827', //贵州卫视

'shdy' => '721355039', //四海钓鱼
'shxwzh' => '651632657', //上海新闻综合高清
'dycj' => '608780988', //第一财经
'dfys' => '617290047', //东方影视高清
'dfds' => '674934424', //东方都市高清
'shjsrw' => '617289997', //上视纪实人文高清
'shics' => '618954688', //上海ICS
'hhxd' => '651638619', //哈哈炫动
'fztd' => '631095330', //法治天地
'hxjc' => '623674859', //欢笑剧场
'xfc' => '623674815', //幸福彩
'qjs' => '623674483', //全纪实

'lttv' => '668225749', //临洮电视台
'hzxwzh' => '650216404', //汉中新闻综合
'hzgg' => '650217163', //汉中公共
'lbtv' => '651810498', //汉中留坝电视台
'gczh' => '716233075', //城固电视台
'yxzh' => '716593482', //洋县电视台

'nqtv1' => '684005412', //宁强电视台1
'nqtv2' => '684004345', //宁强电视台2
'lytv' => '684003723', //略阳1
'zbzh' => '684004346', //镇巴综合
'lxtv' => '671521015', //陇西电视台

'sdjy' => '609154353', //SDETV山东教育

'jyjs' => '623604663', //金鹰纪实

'jscs' => '626064714', //江苏城市
'jsgg' => '626064693', //江苏公共新闻
'jsty' => '626064707', //江苏体育休闲
'jsxx' => '626881786', //江苏学习
'hxgw' => '626064668', //好享购物
'jslz' => '626064675', //江苏靓妆
'ymkt' => '626064703', //优漫卡通

'czxwzh' => '639731892', //常州新闻综合
'szxwzh' => '639731952', //苏州新闻综合
'sqxwzh' => '639731832', //宿迁新闻综合
'haxwzh' => '639731826', //淮安新闻综合

'jjkt' => '614952364', //嘉佳卡通

'hjjc' => '625155140', //黄金剧场
'jljc' => '625643517', //军旅剧场
'kzlp' => '625542372', //抗战老片
'xjlm' => '637444830', //喜剧联盟
'rjlb' => '629943613', //热剧联播
'gqdp' => '629943678', //高清大片
'jsjc' => '627033504', //僵尸剧场
'sljc' => '625526423', //少林剧场
'smjc' => '625759558', //深夜失眠剧场
'dzjc' => '634274665', //红色谍战剧场
'khdy' => '625204865', //每日科幻电影
'zjsn' => '617432318', //追剧少女
'hjlp' => '621640582', //怀旧老片
'wxjc' => '627198822', //武侠剧场
'jdys' => '627198751', //经典影视速看
'jqjc' => '627198692', //假期剧场
'gjjc' => '625542365', //国际剧场
'jdfyt' => '685902551', //经典放映厅
'gfyy' => '627198191', //高分影院
'xpfyt' => '619495952', //新片放映厅
'clzpj' => '707671890', //成龙作品集
'zxcyy' => '623338112', //周星驰影院
'ldhyy' => '659315648', //刘德华影院
'jdhsp' => '625774662', //经典贺岁片
'gtlyy' => '627198610', //古天乐影院
'lyfys' => '639528386', //刘亦菲影视展播
'glnz' => '625133682', //古力娜扎影视展播
'jypd' => '625774640', //金庸频道
'glzpj' => '639528313', //古龙作品集
'gfcyy' => '639528330', //郭富城影院
'zgryy' => '707689526', //张国荣影院
'cuva' => '712723873', //CUVA频道
'stdrj' => '625574493', //神探狄仁杰
'hljc' => '625498432', //红楼剧场
'aqgy' => '625681367', //爱情公寓
'ysdyy' => '625703337', //云上电影院
'dmffl' => '625525181', //盗墓方法论
'zyxc' => '621640581', //综艺现场
'snh48jcgy' => '617432328', //SNH48剧场公演
'sszjd' => '646596895', //赛事最经典
'mcdzz' => '639528180', //萌宠大作战
'sddh' => '637483721', //试胆大会
'xsxpjx' => '625133682', //相声小品精选
'zqzyp' => '629942228', //最强综艺趴
'imode' => '665063310', //Imode时尚频道
'jkzg' => '685902423', //健康中国
'yxels' => '713599117', //影像俄罗斯
'hslbt' => '713600957', //红色轮播台
);
$d = file_get_contents('http://www.miguvideo.com/playurl/v1/play/playurlh5?&rateType=3&contId='.$n[$id]);
$e = json_decode($d)->body->urlInfo->url;
$userid = str_split("");
$timestamp =str_split(explode('=',explode('&',$e)[6])[1]);
$ProgramID =str_split ($n[$id]);
$Channel_ID = str_split("0116_25000000-99000-100300010010001");
$puData =str_split (explode('=',explode('&',$e)[21])[1]);
$number =str_split("2624");
$s=count($puData);
for($v=0;$v<$s/2;$v++){
$arr_key[]=$puData[$s-$v-1];
$arr_key[]=$puData[$v];
switch ($v){
case 1:
$chars= $userid[$number[0]];
$arr_key[]=arrkey($chars,$v);
break;
case 2:
$chars= $timestamp[$number[1]];
$arr_key[]=arrkey($chars,$v);
break;
case 3:
$chars= $ProgramID[$number[2]];
$arr_key[]=arrkey($chars,$v);
break;
case 4:
$chars=$Channel_ID[count($Channel_ID)-$number[3]];
$arr_key[]=arrkey($chars,$v);
break;
}
}
$ddCalcu=join($arr_key);

function arrkey($chars,$v){
$put=['e','t','c','n'];
if($chars!==null){
$mark=$chars;
}else{
$mark=$put[$v-1];
}
return $mark;
}
$playurl = $e."&ddCalcu=".$ddCalcu;
header('Location:'.$playurl);
//echo $playurl ;
?->

山东电视台php

<-?php
$id = isset($_GET['id'])?$_GET['id']:'sdtv';
/*山东卫视id=sdtv;齐鲁id=qlpd;文旅id=yspd;综艺id=zypd;生活id=shpd;新闻id=ggpd;农科id=nkpd;体育id=typd;少儿id=sepd;国际id=gjpd;居家购物id=gwpd;*/
preg_match('|iqilu/(.*?).m3u8|',file_get_contents('http://v.iqilu.com/live/'.$id.'/'),$p);
header('location:https://livealone302.iqilu.com/iqilu/'.$p[1].'.m3u8');
//echo 'https://livealone302.iqilu.com/iqilu/'.$p[1].'.m3u8';
?->

江苏台php更新

<-去掉?php

$id = isset($_GET['id'])?$_GET['id']:'jsws';
/*
江苏卫视id=jsws
江苏城市id=jscs
江苏公共新闻id=jsgg
江苏综艺id=jszy
江苏影视id=jsys
江苏体育id=jsty
江苏教育id=jsjy
江苏学习id=jsxx
江苏靓妆id=jslz
江苏国际id=jsgj
好享购物id=hxgw
优漫卡通id=ymkt
*/
$e = 'https://live-hls.jstv.com/livezhuzhan/'.$id.'@jstv2m.m3u8';
$a = '/livezhuzhan/'.$id.'@jstv2m.m3u8';
$r = "jstvlivezhuzhan@2022cdn!@#124gg";
$i = time()+300;
$o = md5($r."&".$i."&".$a);
$l = substr($o,12,8);
$d = $l.$i;
$m3u8 = $e."?upt=".$d;
header('location:'.$m3u8);
//echo $m3u8
?-去掉>