|

- <?php
- $id = isset($_GET['id'])?$_GET['id']:'gsws';
- $n= array(
- 'gsws' => '6e1sy2',//甘肃卫视
- 'gsjj' => '10iv1j',//甘肃经济
- 'gswh' => 'w1l6d5',//甘肃文化影视
- 'gsgg' => '3t5xyc',//甘肃公共应急
- 'gsse' => '922k96',//甘肃少儿
- 'gsds' => 'l54391',//甘肃都市
- 'gsyd' => 'y72q36',//甘肃移动电视
- );
- $m3u8 = 'https://hls.gstv.com.cn/49048r/'.$n[$id].'.m3u8';
-
- if (empty($_GET['ts'])){
- print_r(preg_replace("/(.*?.ts)/i","gstv.php?ts=https://hls.gstv.com.cn/49048r/$1",getdata($m3u8,1)));
- } else {
- $ts = getdata($_GET['ts'],0);
- echo $ts;
- }
-
- function getdata($url,$type){
- $h = array(
- "User-Agent: Mozilla/5.0 (Windows NT 6.1)",
- "Referer: https://www.gstv.com.cn/zxc.jhtml",
- );
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, $type);
- 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, $h);
- $data = curl_exec($ch);
- curl_close($ch);
- return $data;
- }
- ?>
复制代码
补充内容 (2022-6-16 17:20):
请问:
在电脑上直接用h5播放器播放甘肃台播放线路(如甘肃卫视:https://hls.gstv.com.cn/49048r/6e1sy2.m3u8)时,若同时打开高网播放页面,可以播放,若关闭官网,就不能播放,是个什么情况?请坛友指教.
补充内容 (2022-6-16 17:21):
''若同时打开高网''为'若同时打开官网' |
|