|
本帖最后由 guoma 于 2023-9-15 14:05 编辑
安徽电视台(pc)又恢复双验证了,修复后的ahtv.php:- <?php
- //https://www.ahtv.cn/folder9000/folder20193?channelIndex=0
- error_reporting(0);
- $ts = $_GET['ts'];
- if(!$ts){
- $id = isset($_GET['id'])?$_GET['id']:'ahws';
- $n = [
- 'ahws' => 47,
- 'ahjjsh' => 71,
- 'ahzyty' => 73,
- 'ahys' => 72,
- 'ahgg' => 50,
- 'ahnykj' => 51,
- 'ahgj' => 70,
- 'ahyd' => 68,
- ];
- $url = 'http://mapi.ahtv.cn/api/open/ahtv/channel.php?appid=m2otdjzyuuu8bcccnq&appkey=5eab6b4e1969a8f9aef459699f0d9000&is_audio=0&category_id=1';
- $d = json_decode(m3u8($url));
- for($i=0;$i<count($d);$i++){
- if($n[$id] == $d[$i] -> id) $m3u8 = $d[$i] -> m3u8;
- }
- $host = 'https://'.parse_url($m3u8)['host'];
- $burl = dirname($m3u8)."/";
- $live = $burl.strstr(m3u8($m3u8),'hd');
- $php = "http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF'];
- //如果你网站协议头是https,将http换成https;
- header('Content-Type: application/vnd.apple.mpegurl');
- print_r(preg_replace("/(.*?.ts)/i", $php."?ts=$host$1",m3u8(trim($live))));
- } else {
- $data = ts($ts);
- header('Content-Type: video/MP2T');
- }
- function m3u8($url){
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
- curl_setopt($ch, CURLOPT_HTTPHEADER, ["User-Agent: Mozilla/5.0",]);
- curl_setopt($ch, CURLOPT_REFERER, 'https://www.ahtv.cn/');
- $result = curl_exec($ch);
- curl_close($ch);
- return $result;
- }
- function ts($url){
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
- curl_setopt($ch, CURLOPT_HTTPHEADER, ["User-Agent: Mozilla/5.0",]);
- curl_setopt($ch, CURLOPT_REFERER, 'https://www.ahtv.cn/');
- $result = curl_exec($ch);
- curl_close($ch);
- }
- ?>
复制代码
发帖注意事项
请勿胡乱发帖:https://www.right.com.cn/forum/thread-8307840-1-1.html
账户手机验证:https://www.right.com.cn/forum/home.php?mod=spacecp&ac=plugin&id=jzsjiale_sms:home
|
|