找回密码
 立即注册
搜索
查看: 145|回复: 8

悬赏武汉综合频道php

[复制链接]

7

主题

235

回帖

253

积分

等离子电视迷

积分
253
发表于 2025-12-24 13:02:45 | 显示全部楼层 |阅读模式
悬赏5海贝已解决

点评

已经解决你的问题了,看回复的代码  发表于 2025-12-24 20:57

2

主题

115

回帖

132

积分

彩电迷

积分
132
发表于 2025-12-24 13:02:46 | 显示全部楼层
<?php
error_reporting(0);
$url='https://clientapi.hannews.com.cn/detail/stream/309413';
$h = [
    'Host:clientapi.hannews.com.cn',
        'Origin:https://m.hannews.com.cn',
    'User-Agent: Mozilla/5.0 (Windows NT 6.1)'
    ];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $h);
$response = curl_exec($ch);
curl_close($ch);
$shuju = xxtea_decrypt(base64_decode($response),'5b28bae827e651b3');
$obj = json_decode($shuju, true);
$playUrl=$obj['data']['data']['playUrl'];
header("location: $playUrl");


       
function xxtea_encrypt($str, $key) {
    if ($str == "") {
        return "";
    }
    $v = str2long($str, true);
    $k = str2long($key, false);
    if (count($k) < 4) {
        for ($i = count($k); $i < 4; $i++) {
            $k[$i] = 0;
        }
    }
    $n = count($v) - 1;

    $z = $v[$n];
    $y = $v[0];
    $delta = 0x9E3779B9;
    $q = floor(6 + 52 / ($n + 1));
    $sum = 0;
    while (0 < $q--) {
        $sum = int32($sum + $delta);
        $e = $sum >> 2 & 3;
        for ($p = 0; $p < $n; $p++) {
            $y = $v[$p + 1];
            $mx = int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
            $z = $v[$p] = int32($v[$p] + $mx);
        }
        $y = $v[0];
        $mx = int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
        $z = $v[$n] = int32($v[$n] + $mx);
    }
    return long2str($v, false);
}

function xxtea_decrypt($str, $key) {
    if ($str == "") {
        return "";
    }
    $v = str2long($str, false);
    $k = str2long($key, false);
    if (count($k) < 4) {
        for ($i = count($k); $i < 4; $i++) {
            $k[$i] = 0;
        }
    }
    $n = count($v) - 1;

    $z = $v[$n];
    $y = $v[0];
    $delta = 0x9E3779B9;
    $q = floor(6 + 52 / ($n + 1));
    $sum = int32($q * $delta);
    while ($sum != 0) {
        $e = $sum >> 2 & 3;
        for ($p = $n; $p > 0; $p--) {
            $z = $v[$p - 1];
            $mx = int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
            $y = $v[$p] = int32($v[$p] - $mx);
        }
        $z = $v[$n];
        $mx = int32((($z >> 5 & 0x07ffffff) ^ $y << 2) + (($y >> 3 & 0x1fffffff) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k[$p & 3 ^ $e] ^ $z));
        $y = $v[0] = int32($v[0] - $mx);
        $sum = int32($sum - $delta);
    }
    return long2str($v, true);
}

function int32($n) {
    while ($n >= 2147483648) $n -= 4294967296;
    while ($n <= -2147483649) $n += 4294967296;
    return (int)$n;
}

function str2long($s, $w) {
    $v = unpack("V*", $s. str_repeat("\0", (4 - strlen($s) % 4) & 3));
    $v = array_values($v);
    if ($w) {
        $v[count($v)] = strlen($s);
    }
    return $v;
}

function long2str($v, $w) {
    $len = count($v);
    $n = ($len - 1) << 2;
    if ($w) {
        $m = $v[$len - 1];
        if (($m < $n - 3) || ($m > $n)) return false;
        $n = $m;
    }
    $s = array();
    for ($i = 0; $i < $len; $i++) {
        $s[$i] = pack("V", $v[$i]);
    }
    if ($w) {
        return substr(join('', $s), 0, $n);
    }
    else {
        return join('', $s);
    }
}

?>

2

主题

272

回帖

280

积分

等离子电视迷

积分
280
发表于 2025-12-24 15:34:09 | 显示全部楼层

7

主题

235

回帖

253

积分

等离子电视迷

积分
253
 楼主| 发表于 2025-12-24 15:48:47 | 显示全部楼层
jishuwo 发表于 2025-12-24 15:34
http://livestream.hannews.com.cn/hannews/1511-hannews.m3u8?txSecret=894cfb3bf400ee80f6b4c1a1ed0bd3ab ...

谢谢,这是时效源

0

主题

13

回帖

13

积分

黑白电视迷

积分
13
发表于 2025-12-24 15:57:23 | 显示全部楼层
https://clientapi.hannews.com.cn/stream/v1/view?id=309413
是不是在这个接口里,好像加密了,等高手来解

2

主题

272

回帖

280

积分

等离子电视迷

积分
280
发表于 2025-12-27 23:31:52 | 显示全部楼层
fxgsfxgs 发表于 2025-12-24 15:48
谢谢,这是时效源

没有时效的用了好久了的

0

主题

81

回帖

81

积分

彩电迷

积分
81
发表于 2025-12-31 23:09:40 | 显示全部楼层

id是多少,用不了么

0

主题

226

回帖

230

积分

等离子电视迷

积分
230
发表于 2026-1-7 09:28:35 | 显示全部楼层
失效了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋

创办于 2025 年 5 月 5 日

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