找回密码
 立即注册
搜索
查看: 298|回复: 13

哪位大神给辽宁地方台**成php

  [复制链接]

15

主题

94

回帖

145

积分

注册会员

积分
145
发表于 2025-11-22 08:38:38 | 显示全部楼层 |阅读模式

点评

<?php $head_httplive = 'http://httplive.slave.bfgd.com.cn:14311'; $head_httpstream = 'http://httpstream.slave.bfgd.com.cn:14312'; function getcurl($url) { $user_agent = "Mozilla/4.0 (compatibl...   发表于 2025-11-23 16:36

0

主题

31

回帖

46

积分

新手上路

积分
46
发表于 2025-11-22 09:48:56 | 显示全部楼层
北方广电有php。不过几分钟就封ip

0

主题

30

回帖

117

积分

注册会员

积分
117
发表于 2025-11-22 14:03:18 | 显示全部楼层
身处辽宁  那更好了  直接 找运营商 源   只有运营商稳定  地方源  当地运营商 网站 这些 有 外地的没有
这个好像移动 源 当地 移动宽带 看 可能稳定点

5

主题

48

回帖

132

积分

注册会员

积分
132
发表于 2025-11-22 15:11:21 | 显示全部楼层
谁有辽宁联通的单播源,不用开通IPTV业务就能看的那种

0

主题

30

回帖

117

积分

注册会员

积分
117
发表于 2025-11-22 16:32:55 | 显示全部楼层
11612158 发表于 2025-11-22 15:11
谁有辽宁联通的单播源,不用开通IPTV业务就能看的那种

记得辽宁联通 有单播源 的  网上搜搜看

0

主题

30

回帖

117

积分

注册会员

积分
117
发表于 2025-11-22 16:44:22 | 显示全部楼层
milug 发表于 2025-11-22 16:32
记得辽宁联通 有单播源 的  网上搜搜看

记错了   单播 好像 也 需要iptv

2

主题

33

回帖

104

积分

注册会员

积分
104
发表于 2025-11-22 16:47:54 来自手机 | 显示全部楼层
CCTV1,http://sh.lnott.top:880/dx01.m3u8
自己套

点评

感谢大佬分享  发表于 2025-11-22 17:13

15

主题

94

回帖

145

积分

注册会员

积分
145
 楼主| 发表于 2025-11-23 07:06:09 | 显示全部楼层
a475624729 发表于 2025-11-22 16:47
CCTV1,http://sh.lnott.top:880/dx01.m3u8
自己套

大神地方卫视怎么套?

5

主题

48

回帖

132

积分

注册会员

积分
132
发表于 2025-11-23 16:36:56 | 显示全部楼层
<?php
$head_httplive = 'http://httplive.slave.bfgd.com.cn:14311';
$head_httpstream = 'http://httpstream.slave.bfgd.com.cn:14312';

function getcurl($url) {
    $user_agent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url); // 设置要访问的URL
    curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); // 模拟用户使用的浏览器
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转
    curl_setopt($ch, CURLOPT_TIMEOUT, 60); // 设置超时时间
    curl_setopt($ch, CURLOPT_AUTOREFERER, 1); // 自动设置Referer
    curl_setopt($ch, CURLOPT_HEADER, 0); // 不显示返回的HEAD区域的内容
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // 返回结果而不是输出
    $result = curl_exec($ch);
    if (curl_errno($ch)) {
        echo 'Error:' . curl_error($ch); // 处理cURL错误
    }
    curl_close($ch);
    return $result;
}

function getinfo_json($chnlid, $token) {
    $i_url = 'http://slave.bfgd.com.cn/media/channel/get_info?chnlid=4200000' . $chnlid . '&accesstoken=' . $token;
    $i_result = file_get_contents($i_url);
    return json_decode($i_result);
}

$accesstoken = 'R5F2408FEU3198804BK78052214IE73560DFP2BF4M340CE68V0Z339CBW1626D4D261E46FEA';

$id = isset($_GET['id']) ? $_GET['id'] : '610';
$type = isset($_GET['type']) ? $_GET['type'] : 'live';

if ($type == 'live') {
    // 直播
    header("ACCESS-CONTROL-ALLOW-ORIGIN:*");
    $json = getinfo_json($id, $accesstoken);
    $playtoken = isset($json->play_token) ? $json->play_token : 'ABCDEFGH';
    $playurl = $head_httplive . '/playurl?playtype=live&protocol=hls&accesstoken=' . $accesstoken . '&programid=4200000' . $id . '&playtoken=' . $playtoken;
    $m3u8 = getcurl($playurl);
    echo preg_replace('/(http):\/\/([^\/]+)/i', $head_httplive, $m3u8);
} elseif ($type == 'list') {
    // 节目单
    $date = isset($_GET['date']) ? $_GET['date'] : date('Y-m-d');
    $time = time();
    $json = getinfo_json($id, $accesstoken);
    echo $json->chnl_name . " " . $date . " 节目单<br/>";
    $list_url = 'http://slave.bfgd.com.cn/media/event/get_list?chnlid=4200000' . $id . '&pageidx=1&vcontrol=0&attachdesc=1&repeat=1&accesstoken=' . $accesstoken . '&starttime=' . strtotime($date) . '&endtime=' . strtotime('+1 day', strtotime($date)) . '&pagenum=100&flagposter=0';
    $list_result = file_get_contents($list_url);
    $list_json = json_decode($list_result);
    $event_list = $list_json->event_list;
    for ($x = 0; $x < count($event_list); $x++) {
        $url = 'bfgd.php?type=back&start=' . date('YmdHis', $event_list[$x]->start_time) . '&end=' . date('YmdHis', $event_list[$x]->end_time) . '&event_id=' . $event_list[$x]->event_id;
        $n = date('H:i', $event_list[$x]->start_time) . ' ' . $event_list[$x]->event_name;
        if ($time > $event_list[$x]->end_time) {
            echo "<a href='{$url}' title=''>$n</a><br/>";
        } else {
            echo $n . "<br/>";
        }
    }
} elseif ($type == 'back') {
    // 回看
    header("ACCESS-CONTROL-ALLOW-ORIGIN:*");
    $start = $_GET['start'];
    $end = $_GET['end'];
    $eventid = $_GET['event_id'];
    $url = 'http://slave.bfgd.com.cn/media/event/get_info?accesstoken=' . $accesstoken . '&eventid=' . $eventid;
    $result = file_get_contents($url);
    $json = json_decode($result);
    $_playtoken = $json->play_token;
    $playurl = $head_httpstream . '/playurl?playtype=lookback&protocol=hls&starttime=' . $start . '&endtime=' . $end . '&accesstoken=' . $accesstoken . '&programid=' . $eventid . '&playtoken=' . $_playtoken;
    $m3u8 = getcurl($playurl);
    echo preg_replace('/(http):\/\/([^\/]+)/i', $head_httpstream, $m3u8);
}
?>

15

主题

94

回帖

145

积分

注册会员

积分
145
 楼主| 发表于 2025-11-23 17:16:02 | 显示全部楼层

php文件制作了,txt列表的ip换作了自己的,但是播放不了啊,辽宁公共,http://192.168.9.111:5080/live/bfgd/4200000077.m3u8 或者辽宁公共,http://120.76.248.139/live/bfgd/4200000077都不行。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|直播源论坛