找回密码
 立即注册
搜索
查看: 196|回复: 7

央视新闻有没有修一下

[复制链接]

74

主题

364

回帖

513

积分

液晶电视迷

积分
513
发表于 2026-1-19 15:38:43 | 显示全部楼层 |阅读模式
本帖最后由 11612158 于 2026-1-19 17:29 编辑

央视新闻这几个高清的频道有没有好用的php,论坛里的失效了

看几分钟就断流了

<?php
/*
食用:File Directory/cctv.php?id=cctv1&q=lg //蓝光线路[1920×1080]
      File Directory/cctv.php?id=cctv1&q=cq //超清线路[1280×720]
      File Directory/cctv.php?id=cctv1&q=gq //高清线路[960×540]
cctv1,https://m-live.cctvnews.cctv.com ... 1200132825562653886
cctv2,https://m-live.cctvnews.cctv.com ... 2030532124776958103
cctv4,https://m-live.cctvnews.cctv.com ... 0620168294224708952
cctv7,https://m-live.cctvnews.cctv.com ... 8516529981177953694
cctv9,https://m-live.cctvnews.cctv.com ... 7252237247689203957
cctv10,https://m-live.cctvnews.cctv.com ... 4589146016461298119
cctv12,https://m-live.cctvnews.cctv.com ... 3180385922471124325
cctv13,https://m-live.cctvnews.cctv.com ... 6265686808730585228
cctv17,https://m-live.cctvnews.cctv.com ... 4496917190172866934
cctv4k,https://m-live.cctvnews.cctv.com ... 2127841942201075403
*/
error_reporting(0);
$id = isset($_GET['id']) ? $_GET['id'] : 'cctv1';
$q = isset($_GET['q']) ? $_GET['q'] : 'lg';//lg:蓝光;cq:超清;gq:高清
$n = [
    'cctv1' => '11200132825562653886', //CCTV1
    'cctv2' => '12030532124776958103', //CCTV2
    'cctv4' => '10620168294224708952', //CCTV4
    'cctv7' => '8516529981177953694', //CCTV7
    'cctv9' => '7252237247689203957', //CCTV9
    'cctv10' => '14589146016461298119', //CCTV10
    'cctv12' => '13180385922471124325', //CCTV12
    'cctv13' => '16265686808730585228', //CCTV13
    'cctv17' => '4496917190172866934', //CCTV17
    'cctv4k' => '2127841942201075403', //CCTV4K
    ];
$t = time();

$sail =  md5("articleId={$n[$id]}&scene_type=6");
$w = "&&&20000009&{$sail}&{$t}&emas.feed.article.live.detail&1.0.0&&&&&";
$k = "emasgatewayh5";
$sign = hash_hmac('sha256', $w, $k);
$url = "https://emas-api.cctvnews.cctv.com/h5/emas.feed.article.live.detail/1.0.0?articleId={$n[$id]}&scene_type=6";
$client_id = md5($t);
$h = [
    'cookieuid: '.$client_id,
    'from-client: h5',
    'referer: https://m-live.cctvnews.cctv.com/',
    'x-emas-gw-appkey: 20000009',
    'x-emas-gw-pv: 6.1',
    'x-emas-gw-sign:' .$sign,
    'x-emas-gw-t:' .$t,
    'x-req-ts:' .$t*1000,
];
$data = get($url,$h);

$data = json_decode(base64_decode(json_decode($data,1)['response']),1)['data'];

if($q == 'lg') $authUrl = $data['live_room']['liveCameraList'][0]['pullUrlList'][0]['authResultUrl'][0]['authUrl'];
if($q == 'cq') $authUrl = $data['live_room']['liveCameraList'][0]['pullUrlList'][0]['authResultUrl'][0]['demote_urls'][1]['authUrl'];
if($q == 'gq') $authUrl = $data['live_room']['liveCameraList'][0]['pullUrlList'][0]['authResultUrl'][0]['demote_urls'][0]['authUrl'];

$key = substr($data['dk'], 0, 8) . substr($t, -8);
$iv = substr($data['dk'], -8) . substr($t, 0, 8);

$live = decrypt($authUrl, $key, $iv);
header('Location: '.$live);
//print_r($live);

function get($url,$header){
    $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, $header);
    $res = curl_exec($ch);
    curl_close($ch);
    return $res;
}

function decrypt($encryptedData, $key, $iv) {
    $encryptedData = base64_decode($encryptedData);
    $decrypted = openssl_decrypt($encryptedData,'AES-128-CBC',$key,OPENSSL_RAW_DATA,$iv);
    return $decrypted;
}
?>

1

主题

60

回帖

65

积分

彩电迷

积分
65
发表于 2026-1-19 16:09:16 | 显示全部楼层
此帖仅作者可见

1

主题

60

回帖

65

积分

彩电迷

积分
65
发表于 2026-1-19 16:25:34 | 显示全部楼层
此帖仅作者可见

点评

好像还是不太行,看一会就断流了。特别是中央1  发表于 2026-1-19 17:37

7

主题

121

回帖

150

积分

彩电迷

积分
150
发表于 2026-1-19 19:54:18 | 显示全部楼层
此帖仅作者可见

7

主题

138

回帖

192

积分

彩电迷

积分
192
发表于 2026-1-20 10:08:16 | 显示全部楼层
此帖仅作者可见

1

主题

60

回帖

65

积分

彩电迷

积分
65
发表于 2026-1-20 10:13:05 | 显示全部楼层
此帖仅作者可见

点评

10--4K不好使  发表于 2026-1-20 11:46
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋

创办于 2025 年 5 月 5 日

快速回复 返回顶部 返回列表