|
本帖最后由 jiteloozz 于 2022-7-12 20:45 编辑
1.尝试写一下时下比较火的抖音直播,在网页端研究了一会儿,发现
https://live.douyin.com/270977872829
https://live.douyin.com/128561854509
https://live.douyin.com/324221092974
等等这样的主播房间地址curl不出数据;
有点意外,一时搞不定,请大神援手~~~
故只做了一个DEMO_PHP,缺点不能定ID代理,测试:
http://mmitv.top/test/douyin.php?id=top
2.前阵子分享了1905电影网CCTV6的代理,昨天发现失效,到官网一看,好家伙又换接口了。
更新代码如下:
<?php
$post ='{"cid":"999999","expiretime":1657294124,"nonce":1657293524,"page":"https://www.1905.com/cctv6/live/","playerid":"352401458995486","streamname":"LIVE2OR14O20ADLYU","uuid":"30a14081-d7bc-47ff-8c93-9b4e812ae248"}';
$ch = curl_init('https://profile.m1905.com/mvod/liveinfo.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: feeaf15b1dad7b43aeb1cc3246b4511dfc9a3217','Content-Type: application/json'));
$data = curl_exec($ch);
curl_close($ch);
$json=json_decode(trim($data,'()'));
$host=$json->data->quality->hd->host;
$path=$json->data->path->hd->path;
$sign=$json->data->sign->hd->sign;
$playurl=$host.$path.$sign;
header("Location: ".$playurl);
可以看到需要Authorization: feeaf15b1dad7b43aeb1cc3246b4511dfc9a3217请求,那么再次请教大神,获取这个Authorization值的思路和方法。。。
3.广东佛山新接口https://xmapi.fstv.com.cn/appapi/tv/indexaes
post出来的数据:
stdClass Object
(
[data] => stdClass Object
(
[channel] => Array
(
[0] => stdClass Object
(
[id] => 2
[name] => 公共频道
[type] => 1
[img] =>
[stream] => AALE/0tY/s1p4xWu27XsFgtkXh7B3+RKOQfukdpata3neSzlZZ8i5zpHHu+0zgw2xLXD1jlwBCeYycwb45OFqbRsCdnVAKSjYPcbGNRytjR/Vjjb/sYgV3fpnqeHYNY6rw/wiR/OdqTTncv6xRjmAUG5W5lpmDIe8y7sEDUfjK0=
)
这个stream里应该就是播放地址了,根据字符串可以base64_decode为一串乱码:(省略)
再结合接口中的aes字符初步判断,地址应该是AES加密。
那么解密的key,IV又从哪里着手~~~?请大神指点一二
附佛山静态地址方法:
在地址前加缓冲IP,无需尾巴。这个缓冲IP好找,虎牙IP段121.51.248.X、121.51.249.X 就有很多个
4.河南官网代理接口JS相关
getChannelList: function() {
var t = this
, e = "6ca114a836ac7d73"
, a = Q()().unix();
_.a.get("/program/getAuth/live/class/program/11/", {
headers: {
sign: ut()(e + a),
timestamp: a
}
我们可以单纯根据sign字符串的位数,就判定是sha256算法吗?而不是根据某个地方ut()的定义值来确认~~~?
附hntv.php(更新了一个第三方封装接口):
<?php
$id = isset($_GET['id'])?$_GET['id']:'hnws';
$n = array(
'hnws' => 145,//河南卫视
'hnds' => 141,//河南都市
'hnms' => 146,//河南民生
'hmfz' => 147,//河南法治
'hndsj' => 148,//河南电视剧
'hnxw' => 149,//河南新闻
'htgw' => 150,//欢腾购物
'hngg' => 151,//河南公共
'hnxc' => 152,//河南乡村
'hngj' => 153,//河南国际
'hnly' => 154,//河南梨园
'wwbk' => 155,//文物宝库
'wspd' => 156,//武术世界
'jczy' => 157,//睛彩中原
'ydxj' => 163,//移动戏曲
'xsj' => 183,//象视界
'zhtc'=> 192,//中华特产
);
switch (date('i')%2) {
case '0'://官网接口
$time = time();
$sign = hash('sha256','6ca114a836ac7d73'.$time);
$header = array(
'timestamp:'.$time,
'sign:'.$sign,
);
$url = 'https://pubmod.hntv.tv/program/getAuth/live/class/program/11';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $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, $header);
$data = curl_exec($ch);
curl_close($ch);
$json= json_decode($data);
foreach ($json as $vas){
if($n[$id] == $vas -> cid){
$playurl = $vas -> video_streams[0];
}
}
break;
default://第三方封装接口
$data=file_get_contents('http://egg.cluster.feiyunbox.com/url/hndt?id='.$n[$id].'&v=666&tm=1646890309&sign=90495af149be7e3693809c2ab2104d7aad49dae689c098388a0e28b5985b324d');
$playurl=json_decode($data)->data;
break;
}
//echo $playurl;
header('Location:'.$playurl);
?>
----------------------------------------------------------
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|