找回密码
 立即注册
搜索
楼主: admin

山东 枣庄

[复制链接]

3

主题

319

回帖

383

积分

等离子电视迷

积分
383
发表于 2026-2-1 13:03:30 | 显示全部楼层
山东 枣庄

0

主题

1

回帖

1

积分

黑白电视迷

积分
1
发表于 2026-2-3 23:36:50 来自手机 | 显示全部楼层
看看,谢谢

1

主题

268

回帖

298

积分

等离子电视迷

积分
298
发表于 2026-2-10 09:08:34 | 显示全部楼层
山东 枣庄

1

主题

268

回帖

298

积分

等离子电视迷

积分
298
发表于 2026-2-10 09:22:14 | 显示全部楼层
本帖最后由 dzwf 于 2026-2-10 09:23 编辑
<?php

//枣庄新闻综合,https://app.zzxwcm.cn/application/tenma01ds_tvradio/view/h5/#/?id=1
//枣庄新闻综合广播,https://app.zzxwcm.cn/application/tenma01ds_tvradio/view/h5/#/?id=2
//枣庄生活娱乐广播,https://app.zzxwcm.cn/application/tenma01ds_tvradio/view/h5/#/?id=3
//枣庄交通广播,https://app.zzxwcm.cn/application/tenma01ds_tvradio/view/h5/#/?id=4
//枣庄动感955,https://app.zzxwcm.cn/application/tenma01ds_tvradio/view/h5/#/?id=5
//枣庄经济生活,https://app.zzxwcm.cn/application/tenma01ds_tvradio/view/h5/#/?id=6
//枣庄公共,https://app.zzxwcm.cn/application/tenma01ds_tvradio/view/h5/#/?id=7
//$id = 1;
$id = $_GET['id'];
go_home_intf($m3u8_url, $id);
go_getAuth_intf($m3u8_url_with_sign, $m3u8_url);
locate($m3u8_url_with_sign);

function locate($m3u8_url_with_sign)
{
    header("Access-Control-Allow-Origin: *");
    header("Location: $m3u8_url_with_sign");
}

function go_getAuth_intf(&$m3u8_url_with_sign, $m3u8_url)
{
    $u = 'https://app.zzxwcm.cn/tenma01ds_tvradio/Apphome/getAuth';
    $h = build_getAuth_request_header($tmtimestamp, $tmrandomnum);
    $d = build_getAuth_request_data($m3u8_url, $tmtimestamp, $tmrandomnum);
    $r = send_request($u, $h, $d);
    $m3u8_url_with_sign = decrypt_getAuth_response($r, $tmtimestamp, $tmrandomnum);
}

function decrypt_getAuth_response($response, $tmtimestamp, $tmrandomnum)
{
    $j = json_decode($response);
    $data = $j->data;
    $key = substr(md5(base64_encode($tmtimestamp).md5($tmtimestamp)), 0, 16);
    $iv = substr(md5($tmrandomnum), 0, 16);
    $r = openssl_decrypt($data, "aes-128-cbc", $key, 0, $iv);
    $j = json_decode($r);
    return $j->auth;
}

function build_getAuth_request_data($m3u8_url, $tmtimestamp, $tmrandomnum)
{
    $a = ['url' => $m3u8_url];
    $data = json_encode($a, JSON_UNESCAPED_SLASHES);
    $key = substr(md5(base64_encode($tmtimestamp).md5($tmrandomnum)), 0, 16);
    $iv = substr(md5(base64_encode($tmrandomnum).md5($tmtimestamp)), 0, 16);
    $r = openssl_encrypt($data, 'aes-128-cbc', $key, 0, $iv);
    $r = 'tm_encrypt_data='.rawurlencode($r);
    return $r;
}

function build_getAuth_request_header(&$tmtimestamp, &$tmrandomnum)
{
    $tmencrypt = 1;
    $tmtimestamp = round(microtime(true) * 1000);
    $tmrandomnum = randomString(16);
    $tmencryptkey = md5(base64_encode(md5($tmtimestamp).$tmrandomnum).$tmrandomnum);
    $a = '';
    $i = 'zh-cn';
    return [
        "Content-Type: application/x-www-form-urlencoded",
        "token: $a",
        "lang: $i",
        "tmencrypt: $tmencrypt",
        "tmtimestamp: $tmtimestamp",
        "tmrandomnum: $tmrandomnum",
        "tmencryptkey: $tmencryptkey"
    ];
}

function randomString($length) {
    $chars = 'abcdefhijkmnprstwxyz2345678';

    $result = '';
    for ($i = 0; $i < $length; $i++) {
        $result .= $chars[mt_rand(0, strlen($chars) - 1)];
    }
    return $result;
}

function go_home_intf(&$m3u8_url, $id)
{
    $u = 'https://app.zzxwcm.cn/tenma01ds_tvradio/Apphome/home?channel_id='.$id;
    $r = send_request($u);
    $j = json_decode($r);
    $c = $j->data->channel_info;
    foreach ($c as $i) {
        if ($i->id == $id) {
            $m3u8_url = $i->m3u8;
            break;
        }
    }
}

function send_request($url, $header = null, $post_data = null) {
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    if (!empty($header))
        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    if (!empty($post_data)) {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    }
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $r = curl_exec($ch);
    curl_close($ch);
    return $r;
}

1

主题

172

回帖

183

积分

彩电迷

积分
183
发表于 2026-2-11 07:11:41 | 显示全部楼层
谢谢,非常感谢

0

主题

45

回帖

132

积分

彩电迷

积分
132
发表于 2026-2-13 18:14:48 | 显示全部楼层
谢谢分享

1

主题

150

回帖

151

积分

彩电迷

积分
151
发表于 3 天前 | 显示全部楼层
感谢分享
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋

创办于 2025 年 5 月 5 日

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