找回密码
 立即注册
搜索
查看: 229|回复: 2

求上海PHP

[复制链接]

1

主题

11

回帖

12

积分

新手上路

积分
12
发表于 2025-11-1 09:17:35 | 显示全部楼层 |阅读模式
求哪位大神有上海的PHP吗

0

主题

6

回帖

14

积分

新手上路

积分
14
发表于 2025-11-2 00:18:52 来自手机 | 显示全部楼层
<?php
error_reporting(0);
$id = $_GET['id'];
$n = [
    'dfws' => '2030', //上海东方卫视
    'xwzh' => '20', //上海新闻综合
    'xjs' => '1600', //上海新纪实
    'mdy' => '1601', //上海魔都眼
    'lypd' => '1745', //上海乐游频道
    'dycj' => '21', //上海第一财经
    'dspd' => '18', //上海都市频道
    'wxty' => '1605', //上海五星体育
];
$apiurl = 'https://bp-api.bestv.cn/cms/api/live/channels';

$context = stream_context_create([
    'ssl' => [
        'verify_peer' => false,
        'verify_peer_name' => false,
    ],
    'http' => [
        'method' => 'POST',
        'header' => "Content-Type: application/json\r\n",
        'content' => '{}'
    ]
]);

$response = file_get_contents($apiurl, false, $context);
//echo $response;
$data = json_decode($response);

foreach ($data->dt as $channel) {
    if ($channel->id == $n[$id]) {
        $playurl = $channel->channelUrl;
        break;
    }
}

header('Location: ' . $playurl);
?>

点评

这个已经失效了。还发。  发表于 2025-11-4 21:53
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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