|
楼主 |
发表于 2025-2-4 15:57:12
|
显示全部楼层
谢谢tqx5201!根据您提供的js代码,改为php成功:
- <?php
- error_reporting(0);
- $id = isset($_GET['id'])?$_GET['id']:'jxws';
- $n = [
- 'jxws' => 'tv_jxtv1.m3u8',//江西卫视
- 'jxds' => 'tv_jxtv2.m3u8',//江西都市
- 'jxjs' => 'tv_jxtv3_hd.m3u8',//江西经视高清
- 'jxys' => 'tv_jxtv4.m3u8',//江西影视
- 'jxgg' => 'tv_jxtv5.m3u8',//江西公共
- 'jxse' => 'tv_jxtv6.m3u8',//江西少儿
- 'jxxw' => 'tv_jxtv7.m3u8',//江西新闻
- 'jxyd' => 'tv_jxtv8.m3u8',//江西移动
- 'fsgw' => 'tv_fsgw.m3u8',//江西风尚购物
- 'jxtc' => 'tv_taoci.m3u8',//江西陶瓷
- ];
- $baseurl = "http://post.wxai.club/httpapi.php";
- $burl = "https://yun-live.jxtvcn.com.cn/live-jxtv/";
- $tourl = $burl."{$n[$id]}?token=1&t=1";
- $post = '{"tourl": "'.$tourl.'","seltype": "GET","jieya": "1"}';
- $ch = curl_init($baseurl);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- $d = curl_exec($ch);
- curl_close($ch);
- $live = json_decode($d,1)['body'];
- header('Content-Type: application/vnd.apple.mpegurl');
- print_r(preg_replace("/(.*?.ts)/i",$burl."$1",$live));
- ?>
复制代码 |
|