CETV APP版代理源码
<?phperror_reporting(0);
$id = isset($_GET['id'])?$_GET['id']:'cetv2';
$n = [
'cetv1' => 417964,
'cetv2' => 437696,
'cetv3' => 445986,
'cetv4' => 445987,
];
$url = "http://m.cetv.cn/ajax/playinfo";
$post = "id={$n[$id]}&appid=11";
$live = json_decode(get($url,$post),1)['data']['player']['m3u8'];
header('Content-Type: application/vnd.apple.mpegurl');
print_r(preg_replace("/(.*?.ts)/i", "http://keybl.centv.cn/live/$1",m3u8($live)));
function get($url,$post){
$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_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
function m3u8($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_HTTPHEADER, ["Referer: app.cetv.cn"]);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
?>
谢谢分享,坐沙发学习。 嗑瓜子,看直播。 https://keybl.centv.cn/这个网址已经不存在了,现在官方直播都改了。。。 https://keybl.centv.cn/这个网址已经不存在了,现在官方直播都改了。。。
页:
[1]