找回密码
 立即注册
搜索
查看: 41|回复: 0

南充顺庆融媒体简化版

[复制链接]

216

主题

811

回帖

1589

积分

OLED电视迷

积分
1589
发表于 2026-1-28 12:43:16 | 显示全部楼层 |阅读模式
本帖最后由 tengfei 于 2026-1-28 12:53 编辑
<?php
function getLivePlaylistAppUrl($disableSslVerify = false) {
    $channelId = 7;
    $sid = "jrsq";
    $secretKey = "7190d04B86924128";
    $host = "www.jinrishunqing.com";
    $url = "https://{$host}/api-w/web/live/playlist";
    $itemDate = date("Y/m/d");
    $params = [
        "channelId" => $channelId,
        "itemDate" => $itemDate,
    ];
    $sig = generateSignature($params, $sid, $secretKey);
    $params['sid'] = $sid;
    $params['sig'] = $sig;
    $fullUrl = $url . "?" . http_build_query($params);
    $headers = [
        "Accept: application/json, text/javascript, */*; q=0.01",
        "Accept-Encoding: gzip, deflate, br, zstd",
        "Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
        "Connection: keep-alive",
        "Host: {$host}",
        "Referer: https://{$host}/live/liveDetail.html?channelId={$channelId}&articleID=10747652",
        "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edge/144.0.0.0",
        "X-Requested-With: XMLHttpRequest",
    ];
    $ch = curl_init();
    $options = [
        CURLOPT_URL => $fullUrl,
        CURLOPT_HTTPHEADER => $headers,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_ENCODING => "",
    ];
    if ($disableSslVerify) {
        $options[CURLOPT_SSL_VERIFYPEER] = 0;
        $options[CURLOPT_SSL_VERIFYHOST] = 0;
    } else {
        $options[CURLOPT_SSL_VERIFYPEER] = 1;
        $options[CURLOPT_SSL_VERIFYHOST] = 2;
    }
    curl_setopt_array($ch, $options);
    $response = curl_exec($ch);
    curl_close($ch);
    $result = json_decode($response, true);
    $appUrl = null;
    if (isset($result['channel']['appUrl']) && json_last_error() === JSON_ERROR_NONE) {
        $appUrl = $result['channel']['appUrl'];
    }
    return $appUrl;
}

function generateSignature($params, $sid, $secretKey) {
    ksort($params);
    $valueString = implode('', $params);
    $signStr = $sid . $valueString . $secretKey;
    return md5($signStr);
}

$appUrl = getLivePlaylistAppUrl(true);
if ($appUrl) {
    header('Location: ' . $appUrl);
    exit;
} else {
    echo "没有获取到有效的 appUrl。";
}
?>
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋

创办于 2025 年 5 月 5 日

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