|
- <?php
- //key:https://www.cztv.com/assets/directSeedingTV-BNsXKazJ.js
- /*调用
- http://host/zsj.php?id=zjws&r=1080&t=m3u8&v=v1
- http://host/zsj.php?id=zjws&r=1080&t=flv&v=v1
- http://host/zsj.php?id=zjws&r=720&t=m3u8&v=v1
- http://host/zsj.php?id=zjws&r=720&t=flv&v=v1
- http://host/zsj.php?id=zjws&r=360&t=m3u8&v=v1
- http://host/zsj.php?id=zjws&r=360&t=flv&v=v1
- http://host/zsj.php?id=zjws&r=1080&v=v2
- http://host/zsj.php?id=zjws&r=720&v=v2
- http://host/zsj.php?id=zjws&r=480&v=v2
- */
- $id = isset($_GET['id'])?$_GET['id']:'zjws';
- $n = [
- 'zjws' => '01', //浙江卫视
- 'zjqj' => '02', //浙江钱江
- 'zjjjsh' => '03', //浙江**生活
- 'zjjkys' => '04', //浙江教科影视
- 'zjmsxx' => '06', //浙江民生休闲
- 'zjxw' => '07', //浙江新闻
- 'zjse' => '08', //浙江少儿
- 'zjgj' => '10', //浙江国际
- 'zjhyg' => '11', //浙江好易购
- 'zjzjjl' => '12', //浙江之江纪录
- ];
- $v = isset($_GET['v'])?$_GET['v']:'v1'; //v1,v2
- $r = isset($_GET['r'])?$_GET['r']:'1080'; //v1:360,720,1080 v2:480,720,1080
- $t = isset($_GET['t'])?$_GET['t']:'m3u8'; //v1:m3u8,flv v2:m3u8
- if($v=='v1') $playurl = v1($n[$id],$r,$t);
- if($v=='v2') $playurl = v2($n[$id],$r);
- header('location:'.$playurl);
- //echo $playurl;
- function v1($id,$r,$t){
- $path = '/channel'.$id.'/'.$r.'p.'.$t;
- $e = time();
- $key = '9T08yiAoqM4eeCwV';
- $s= md5($path.'-'.$e.'-0-0-'.$key);
- $auth_key = $e.'-0-0-'.$s;
- $arr = ['zhfivel02','zhfivel04','zhfivel06'];
- $ip1 = $arr[array_rand($arr)];
- $playurl = "http://$ip1.cztv.com$path?auth_key=$auth_key";
- return $playurl;
- }
- function v2($id,$r){
- $path = '/live/channel'.$id.$r.'P.m3u8';
- $e = time();
- $key = 'CHWr9VybUeBZE1VB';
- $s= md5($path.'-'.$e.'-0-0-'.$key);
- $auth_key = $e.'-0-0-'.$s;
- $arr = ['zwebl02','zwebl04','zwebl06'];
- $ip1 = $arr[array_rand($arr)];
- $playurl = "http://$ip1.cztv.com$path?auth_key=$auth_key";
- return $playurl;
- }
- ?>
复制代码
|
|