|
本帖最后由 隐形的肩膀 于 2022-6-19 20:21 编辑
- <?php
- //$m = curl_init("https://m.1905.com/m/cctv6/gzh");
- $m = curl_init("https://www.1905.com/api/live/home_live_cctv6.xml");
- curl_setopt($m,CURLOPT_RETURNTRANSFER,1);
- curl_setopt($m,CURLOPT_HTTPHEADER,array('User-Agent: Mozilla/5.0'));
- $r = curl_exec($m);
- curl_close($m);
- //preg_match("/video:\'(.*?)\'/",$r,$matches);
- preg_match_all("/url="(.*?)"/",$r,$matches);
- //print_r($matches);
- $playurl=$matches[1][5];
- header('Location:'.$playurl);
- ?>
复制代码- <?php
- $m = curl_init("https://m.1905.com/m/1905tv/live/");
- curl_setopt($m,CURLOPT_RETURNTRANSFER,1);
- curl_setopt($m,CURLOPT_HTTPHEADER,array('User-Agent: Mozilla/5.0'));
- $r = curl_exec($m);
- curl_close($m);
- preg_match("/video:\'(.*?)\'/",$r,$matches);//print_r($matches);
- $playurl=$matches[1];
- header('Location:'.$playurl);
- ?>
复制代码
|
|