|
测试:http://mmitv.top/test/airadio.php?id=onair
代码回复可见:
- <?php
- header('Content-Type: text/json;charset=UTF-8');
- $id = isset($_GET['id'])?$_GET['id']:'onair';
- $ids = array(
- 'onair' => 'RA000018',//
- 'jazz' => 'RA000109',//
- 'goodies' => 'RA000120',//
- 'kids' => 'RA000129',//
- 'urclassical' => 'RA000130',//
- '1' => 'RA000018',//
- '2' => 'RA000109',//
- '3' => 'RA000120',//
- '4' => 'RA000129',//
- '5' => 'RA000130',//
- );
- $url='https://www.e-classical.com.tw/index.html';
- $str=get_data($url);
- preg_match("|'src','(.*?)$ids[$id](.*?)\'|",$str,$url);
- $playurl=str_replace('playlist','chunklist',$url[1].$ids[$id].$url[2]);
- $live=str_replace('https','http',strstr($playurl,'chunklist',true));
- $ts=get_data($playurl);
- print_r(preg_replace("/(.*?.ts)/i","$live$1",$ts));
- function get_data($url){
- $header=array(
- "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64) AppleWebKit/536.26 (KHTML, like Gecko) Chrome/86.0.3282.186 Safari/537.36 ",
- "Referer: https://www.e-classical.com.tw/",
- );
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1 );
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- $data = curl_exec($ch);
- curl_close($ch);
- return $data;
- }
- ?>
复制代码
|
评分
-
查看全部评分
|