mustmax
发表于 2024-8-28 20:20:32
看看什么 情况
bbs506
发表于 2024-8-28 20:21:42
66666666666666666
dingzheng
发表于 2024-8-28 20:26:41
人生没有彩排,每天都是直播
bbs506
发表于 2024-8-28 20:39:53
三个线路都会卡
badxsff
发表于 2024-8-28 21:12:22
加REFERER验证
yyychn
发表于 2024-8-28 21:58:50
大神出手,必属精品。
yoyocococo
发表于 2024-8-28 21:59:42
谢分享,长知识了
hay
发表于 2024-8-28 22:15:03
4个频道线路加REFERER验证了
hw5837
发表于 2024-8-28 22:22:06
{:2_25:}{:2_33:}
蛋蛋侠
发表于 2024-8-28 22:32:21
看看怎么样??
guoma
发表于 2024-8-28 22:38:28
本帖最后由 guoma 于 2024-8-28 22:43 编辑
fxgsfxgs 发表于 2024-8-28 11:44
看看,看个电视不容易啊
安徽台php一直正常
<?php
error_reporting(0);
$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';
foreach(json_decode(get($url),1) as $v){
if($n[$id] == $v['id'])
$m3u8 = $v['m3u8'];
}
if($id=='ahgj'||$id=='ahyd'){
header('Content-Type: application/vnd.apple.mpegurl');
header('location:'.$m3u8);
echo $m3u8;
} else {
$ts = $_GET['ts'];
if(!$ts){
$burl = dirname($m3u8)."/";
$live = $burl.strstr(get($m3u8),'hd');
$burl = 'http://'.parse_url($live)['host'];
$php = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
header('Content-Type: application/vnd.apple.mpegurl');
print_r(preg_replace("/(.*?.ts)/i", $php."?ts=$burl$1",get(trim($live))));
} else {
$data = ts(trim($ts));
header('Content-Type: video/MP2T');
echo $data;
}
}
function get($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_REFERER, 'http://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, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Referer: http://www.ahtv.cn/']);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
?>
lyfdr81
发表于 2024-8-28 22:46:33
这个需要试试