developer 发表于 2024-5-28 21:38:17

1905 PHP代码修复


<?php
error_reporting(0);
$id = $_GET["id"] ?? "cctv6";
$n = [
    "cctv6" => "LIVEOCTI36HXJXB9U",
    "1905a" => "LIVENCOI8M4RGOOJ9",
    "1905b" => "LIVE8J4LTCXPI7QJ5",
];
$ts = time();
$salt = "2bcc2c6ab75dac016d20181bfcd1ee0697c78018";
$playerId = substr($ts, 6) . substr(rand(), -3) . substr(rand(), -8);
$uuid = strtolower(
    sprintf(
      "%04X%04X-%04X-%04X-%04X-%04X%04X%04X",
      mt_rand(0, 65535),
      mt_rand(0, 65535),
      mt_rand(0, 65535),
      mt_rand(16384, 20479),
      mt_rand(32768, 49151),
      mt_rand(0, 65535),
      mt_rand(0, 65535),
      mt_rand(0, 65535)
    )
);
$params = [
    "cid" => 999999,
    "expiretime" => $ts + 600,
    "nonce" => $ts,
    "page" => "https://www.1905.com/",
    "playerid" => $playerId,
    "streamname" => $n[$id],
    "uuid" => $uuid,
];
$sign = sha1(http_build_query($params) . "." . $salt);
$params["appid"] = "GEalPdWA";
$post = json_encode($params);
$url = "https://profile.m1905.com/mvod/liveinfo.php";
$headers = ["Authorization: " . $sign, "Content-Type: application/json"];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$data = curl_exec($ch);
curl_close($ch);
$json = json_decode($data);
$playurl =
    "https://hlslive.1905.com/live/$n[$id]/index.m3u8" .
    $json->data->sign->hd->sign;
header("Content-Type: application/vnd.apple.mpegURL");
header("location:" . $playurl);
?>





来自https://www.tvzb.com/thread-1401-1-1.html
算法一样 只是修改了一下 playerid的生成规则
更新了 盐 和 appid

用户1234 发表于 2024-5-28 21:46:06

感谢分享

wwwEEE 发表于 2024-5-28 21:55:08

chenfeilf 发表于 2024-5-28 21:57:15

感谢分享

lyg 发表于 2024-5-28 22:11:05

看一看,试一试

M82A1 发表于 2024-5-28 22:12:45

向大佬致敬,学习。

lsh 发表于 2024-5-28 22:45:25

感谢分享

ΑΙ 发表于 2024-5-28 22:47:45

感谢分享         

fhgckj 发表于 2024-5-28 22:52:30

谢谢分享            

lylpzqjm 发表于 2024-5-28 22:53:16

谢谢分享!

cqh2004 发表于 2024-5-28 23:05:03

什么东东?

zqs125 发表于 2024-5-28 23:16:30

非常感谢。。。。。
页: [1] 2 3 4 5 6 7 8 9
查看完整版本: 1905 PHP代码修复