guoma 发表于 2023-9-21 15:43:21

CETV APP版代理源码

<?php
error_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;
}
?>

86 发表于 2023-9-21 17:21:20

谢谢分享,坐沙发学习。

昵称已经被占用 发表于 2023-12-7 23:50:07

easy2003 发表于 2024-2-17 14:06:25

嗑瓜子,看直播。

gogogo2000 发表于 2024-5-22 20:37:51

https://keybl.centv.cn/这个网址已经不存在了,现在官方直播都改了。。。

tt_2008 发表于 2024-5-24 16:56:12

https://keybl.centv.cn/这个网址已经不存在了,现在官方直播都改了。。。
页: [1]
查看完整版本: CETV APP版代理源码