33 lines
1.3 KiB
PHP
33 lines
1.3 KiB
PHP
<?php
|
|
error_reporting(0);
|
|
$id = $_GET['id']??'cctv2';
|
|
$q = $_GET['q']??'1';//1,蓝光;4,超清;8,高清
|
|
$n = [
|
|
'cctv1' => ['11200132825562653886','0916dc838fce69425b9aed6d3e790f49'],//CCTV1
|
|
'cctv2' => ['12030532124776958103','102ebab86b52dcb7d437aa64cac55223'],//CCTV2
|
|
'cctv4' => ['10620168294224708952','bbb5af21098ef891310f3e95aca7eaa0'],//CCTV4
|
|
'cctv13' => ['16265686808730585228','563e1000aabda6bdda96248302d34051'],//CCTV13
|
|
];
|
|
$t = time();
|
|
$w = "&&&20000009&{$n[$id][1]}&{$t}&emas.feed.article.live.detail&1.0.0&&&&&";
|
|
$k = "emasgatewayh5";
|
|
$sign = hash_hmac('sha256', $w, $k);
|
|
$url = "https://emas-api.cctvnews.cctv.com/h5/emas.feed.article.live.detail/1.0.0?articleId={$n[$id][0]}&scene_type=6";
|
|
$h = [
|
|
'x-emas-gw-appkey: 20000009',
|
|
'x-emas-gw-pv: 6.1',
|
|
'x-emas-gw-sign:' .$sign,
|
|
'x-emas-gw-t:' .$t,
|
|
];
|
|
$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);
|
|
$data = curl_exec($ch);
|
|
curl_close($ch);
|
|
$response = json_decode(base64_decode(json_decode($data,1)['response']),1);
|
|
$playurl = $response['data'] ['live_room']['liveCameraList'][0]['pullUrlList'][$q]['authResultUrl'][0]['authUrl'];
|
|
header('location:'.$playurl);
|
|
//print_r($playurl);
|
|
?>
|