|
- <?php
- error_reporting(0);
- $id = isset($_GET['id'])?$_GET['id']:'cctv13gq';
- $n = [
- 'cctv13lg' => 1,//蓝光
- 'cctv13cq' => 4,//超清
- 'cctv13gq' => 8,//高清
- ];
- $t=time();
- $word="&&&20000009&563e1000aabda6bdda96248302d34051&".$t."&emas.feed.article.live.detail&1.0.0&&&&&";
- $key="emasgatewayh5";
- $sign = hash_hmac("sha256", $word, $key, 0);
- $h = [
- 'x-emas-gw-appkey: 20000009',
- 'x-emas-gw-pv: 6.1',
- 'x-emas-gw-sign:'.$sign,
- 'x-emas-gw-t:'.$t
- ];
- $url="https://emas-api.cctvnews.cctv.com/h5/emas.feed.article.live.detail/1.0.0?articleId=16265686808730585228&scene_type=6";
- $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);
- $json = json_decode($d);
- $playurl = json_decode(base64_decode($json->response),1)['data']['live_room']['liveCameraList'][0]['pullUrlList'][$n[$id]]['authResultUrl'][0]['authUrl'];
- header('location:' . $playurl);
- //echo $playurl;
- ?>
复制代码
|
|