|
- <?php
- error_reporting(0);
- header('Content-Type: application/json;charset=UTF-8');
- $id = isset($_GET['id']) ? $_GET['id'] : 'jsys';
- $n = [
- 'jsws' => '0', //江苏卫视
- 'jscs' => '1', //江苏城市
- 'jszy' => '2', //江苏综艺
- 'jsys' => '3', //江苏影视
- 'jsxw' => '4', //江苏新闻
- 'jsty' => '5', //江苏体育
- 'ymkt' => '6', //优漫卡通
- 'jsgj' => '7', //江苏国际
- 'jsjy' => '8', //江苏教育
- ];
- $tm = time();
- $sign = md5('9dd4b0400f6e4d558f2b3497d734c2b4/JwtAuth/GetWebToken?AppID=3b93c452b851431c8b3a076789ab1e14appId3b93c452b851431c8b3a076789ab1e14platform41uuidD5COmve6IQgwXvsJ4E3uxBstqxtDSCYW' .$tm);
- $apiAuthUrl = "https://api-auth-lizhi.jstv.com/JwtAuth/GetWebToken?AppID=3b93c452b851431c8b3a076789ab1e14&TT=".transformTimestamp($tm)."&Sign={$sign}";
- $post = '{"platform":41,"uuid":"D5COmve6IQgwXvsJ4E3uxBstqxtDSCYW","appId":"3b93c452b851431c8b3a076789ab1e14"}';
- $cont = stream_context_create([
- 'http'=>['method'=>"POST",
- 'header'=>['Content-Type: application/json','Referer: https://live.jstv.com/'],
- 'content'=>$post
- ]]);
- $str = file_get_contents($apiAuthUrl, null, $cont);
- $data = json_decode($str, 1);
- $authorization = $data['data']['accessToken'];
- $playDataUrl = 'https://publish-lizhi.jstv.com/nav/8385';
- $con = stream_context_create([
- 'http'=>['method'=>"GET",
- 'header'=>["Authorization: Bearer $authorization"]
- ]]);
- $str = file_get_contents($playDataUrl, null, $con);
- $data = json_decode($str, 1);
- $playUrl = $data['data']['articles'][$n[$id]]['extraJson']['url'];
- header('location:'.$playUrl);
- //echo $playUrl;
- exit;
- function transformTimestamp($timestamp) {
- $parts = [
- 255 & $timestamp,
- ($timestamp & 65280) >> 8,
- ($timestamp & 16711680) >> 16,
- ($timestamp & 4278190080) >> 24
- ];
- foreach ($parts as &$part) {
- $part = (240 & $part) ^ 240 | 1 + ($part & 15) & 15;
- }
- return $parts[3] | (($parts[2] << 8) << 32) >> 32 | (($parts[1] << 16) << 32) >> 32 | (($parts[0] << 24) << 32) >> 32;
- }
- ?>
复制代码
|
评分
-
查看全部评分
|