cctv13代理源码
<?phprequire("0.php");
$id=$_REQUEST['id'];
$ids = array(
"cctv13hd"=>"2",
"cctv13"=>"1",
"cctv13a"=>"0",
);
//https://m-live.cctvnews.cctv.com/live/landscape.html?liveRoomNumber=16265686808730585228
function get_data($url,$xt,$xsign) {
$ch = curl_init();
$timeout = 3;
$headers = array(
'cookieuid: 7ea450915983427289850fd86f89cc2a',
'from-client: h5',
'origin: https://m-live.cctvnews.cctv.com',
'referer: https://m-live.cctvnews.cctv.com/',
'sec-fetch-dest: empty',
'sec-fetch-mode: cors',
'sec-fetch-site: same-site',
'user-agent: Mozilla/5.0 (Linux; Android 8.0.0; SM-G955U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Mobile Safari/537.36',
'userid: 7ea450915983427289850fd86f89cc2a',
'x-emas-gw-appkey: 20000009',
'x-emas-gw-pv: 6.1',
'x-request-id: 7ea450915983427289850fd86f89cc2a',
);
array_push($headers,'x-emas-gw-t: '.$xt);
array_push($headers,'x-emas-gw-sign: '.$xsign);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$xt=time();
$passWord="&&&20000009&563e1000aabda6bdda96248302d34051&".$xt."&emas.feed.article.live.detail&1.0.0&&&&&";
$secret="emasgatewayh5";
$xsign = hash_hmac("sha256", utf8_encode($passWord), $secret, false);
$url="https://emas-api.cctvnews.cctv.com/h5/emas.feed.article.live.detail/1.0.0?articleId=16265686808730585228&scene_type=6";
$info=get_data($url,$xt,$xsign);
$json=json_decode($info);
$response=$json->response;
$decode=base64_decode($response);
$json1=json_decode($decode);
$liveurl=$json1->data->live_room->liveCameraList->pullUrlList->authResultUrl->demote_urls[$ids[$id]]->originUrl;
header('location:' . $liveurl);
?>
这东西怎么用?我理解不了,感谢指点一二! 就只有CCTV3吗 整个全套的把 jxnklgb 发表于 2024-4-3 13:16
就只有CCTV3吗 整个全套的把
因为官网只有13直播没加密 jxnklgb 发表于 2024-4-3 13:16
就只有CCTV3吗 整个全套的把
因为这CCTV13是单独一个 对外宣传肯定会有一二个免费的,不会封死的
<?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']['pullUrlList'][$n[$id]]['authResultUrl']['authUrl'];
header('location:' . $playurl);
//echo $playurl;
?> 感谢大神们地分享
guoma 发表于 2024-4-3 16:37
大佬出手果然非同凡响! 只是这一生 发表于 2024-4-3 12:39
这东西怎么用?我理解不了,感谢指点一二!
php服务器转发出来 有静态码不用,用代理? 电视114 发表于 2024-4-4 08:27
有静态码不用,用代理?
静态过段时间就会失效 感谢guoma大师分享。 guoma 发表于 2024-4-3 16:37
请教一下word值“563e1000aabda6bdda96248302d34051”的来源。谢谢
页:
[1]
2