|
- <?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");
- }
- ?>
复制代码
这东西说更新了吧又好像没更新,没啥区别,v2 v3都能用。
上次gdtv后边想扔出来,结果被骂的我一脸懵逼?我欠谁的???? |
|