├── 1905_cctv6.php
├── README.md
├── brtv.php
├── bttime.php
├── chaozhoujieyang.php
├── cqyx_q.php
├── dxxw.php
├── dylive.php
├── gdtv.php
├── huya.php
├── pptv.php
├── sh5gtv.php
├── touchtv.php
├── vvvdj.php
├── xwlj.php
└── yspweb.php
/1905_cctv6.php:
--------------------------------------------------------------------------------
1 | 999999,
15 | 'expiretime'=> $ts+600,
16 | 'nonce'=> $ts,
17 | 'page'=> 'https://www.1905.com/',
18 | 'playerid'=> '0', // 测试这里可以为 0 或者使用上边的算法也成
19 | 'streamname'=> $sStreamName,
20 | 'uuid'=> strtolower(createNewGUID())
21 | ];
22 |
23 | $sign = sha1(http_build_query($params).'.'.$salt);
24 | $params['appid'] = 'W0hUwz8D';
25 | $headers = [
26 | 'Authorization: '.$sign,
27 | 'Content-Type: application/json',
28 | 'Origin: https://www.1905.com'
29 | ];
30 |
31 | $ch = curl_init();
32 | curl_setopt($ch, CURLOPT_URL, $bstrURL);
33 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
34 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
35 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
36 | curl_setopt($ch, CURLOPT_POST,true);
37 | curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
38 | curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($params));
39 | $data = curl_exec($ch);
40 | curl_close($ch);
41 | $json = json_decode($data);
42 |
43 | // 替换暂时不需要referer的域名 //
44 | $playURL = 'https://hlslive2.ks-cdn.m1905.com'.$json->data->path->hd->uri.$json->data->sign->hd->hashuri;
45 | header('location:'.$playURL);
46 |
47 | function createNewGUID()
48 | {
49 | if (function_exists('com_create_guid') === true)
50 | {
51 | return trim(com_create_guid(), '{}');
52 | }
53 | return 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));
54 | }
55 | ?>
56 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Any2parse
2 | 一堆奇奇怪怪的php解析源码
3 |
4 | 只是单纯喜欢搞来搞去,不卖码,不卖APP,更加不卖身.....
5 | 有需求请.....
6 |
7 |
8 | UPDATE:
9 | 随缘更新,随便捡漏,拒绝搬运到山上,谢谢!
10 |
--------------------------------------------------------------------------------
/brtv.php:
--------------------------------------------------------------------------------
1 | '573ib1kp5nk92irinpumbo9krlb', //北京卫视
7 | 'bjwy'=>'54db6gi5vfj8r8q1e6r89imd64s', //BRTV文艺
8 | 'bjkj'=>'53bn9rlalq08lmb8nf8iadoph0b', //BRTV科教
9 | 'bjys'=>'50mqo8t4n4e8gtarqr3orj9l93v', //BRTV影视
10 | 'bjcj'=>'50e335k9dq488lb7jo44olp71f5', //BRTV财经
11 | 'bjsh'=>'50j015rjrei9vmp3h8upblr41jf', //BRTV i生活
12 | 'bjqn'=>'53grctge7jb8aeamggnot6fve1o', //BRTV青年
13 | 'bjxw'=>'53gpt1ephlp86eor6ahtkg5b2hf', //BRTV新闻
14 | 'kkdh'=>'55skfjq618b9kcq9tfjr5qllb7r', //卡酷少儿
15 | ];
16 |
17 | $id = strtolower(isset($_GET['id'])?$_GET['id']:'bjws');
18 | $id = $ids[$id];
19 | $ts = time();
20 | $salt = 'shi!@#$%^&*[xian!@#]*';
21 | $apiURL = "https://app.api.btime.com/video/play?";
22 | $params = 'browse_mode=1&carrier=中国电信&channel=btimeapp&gid='.$id.'&id='.$id.'&location_citycode=local_440000&manuscript=0&net=WIFI&os=AND&os_type=Android&os_ver=23&protocol=2&push_id=f8f7f0cbef2001e7e5378f45b0c3162b&push_switch=1&sid=&src=lx_android×tamp='.$ts.'&token=95d8929924a34879151ad50ddce3c3eb&type_id=&ver=70106';
23 | $sign = substr(md5($params.$salt),3,7);
24 | $apiURL = $apiURL.$params.'&sign='.$sign;
25 | $ch = curl_init();
26 | curl_setopt($ch, CURLOPT_URL, $apiURL);
27 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
28 | curl_setopt($ch, CURLOPT_HTTPHEADER, ['User-Agent: okhttp/3.9.1']);
29 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
30 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
31 | $data = curl_exec($ch);
32 | curl_close($ch);
33 |
34 | $json = json_decode($data);
35 | $playURL = $json->data->video_stream[0]->stream_url;
36 | header('location:'.$playURL);
37 |
38 | ?>
39 |
--------------------------------------------------------------------------------
/bttime.php:
--------------------------------------------------------------------------------
1 | data->video_stream[0]->stream_url)));
24 | header("location:". $playURL);
25 |
26 | ?>
27 |
--------------------------------------------------------------------------------
/chaozhoujieyang.php:
--------------------------------------------------------------------------------
1 | ";
10 | $sign = md5("ukcgq412312212d8ag123asdfsds/czbtv2019/czzhpd$ts");
11 | $bstrURL = "rtmp://pili-live-rtmp.czbtv.sobeylive.com/czbtv2019/czzhpd?sign=$sign&t=$ts";
12 | echo $bstrURL."
";
13 |
14 | //揭阳手机台
15 |
16 | $sign = md5("stjy202008050212323221saeaebasdf123/stjy2020/zhpd$ts");
17 | $bstrURL = "rtmp://rtmp-stjy.sobeylive.com/stjy2020/zhpd?sign=$sign&t=$ts";
18 | echo $bstrURL."
";
19 |
20 |
21 | $sign = md5("stjy202008050212323221saeaebasdf123/stjy2020/ggpd$ts");
22 | $bstrURL = "rtmp://rtmp-stjy.sobeylive.com/stjy2020/ggpd?sign=$sign&t=$ts";
23 | echo $bstrURL."
";
24 | ?>
25 |
--------------------------------------------------------------------------------
/cqyx_q.php:
--------------------------------------------------------------------------------
1 | ["4","a48k","1"],
9 | "cctv2HD"=>["6","a48k","1"],
10 | "cctv3HD"=>["6","a48k","1"],
11 | "cctv4HD"=>["6","a48k","3"],
12 | "cctv5HD"=>["6","a48k","1"],
13 | "cctv5SportHD"=>["6","a48k","1"],
14 | "cctv6HD"=>["6","a48k","1"],
15 | "cctv7HD"=>["6","a48k","3"],
16 | "cctv8HD"=>["6","a48k","1"],
17 | "cctv9HD"=>["6","a48k","1"],
18 | "cctv10HD"=>["6","a48k","1"],
19 | "cctv11HD"=>["6","a48k_zho","1"],
20 | "cctv12HD"=>["6","a48k","3"],
21 | "CCTVNewsHD"=>["4","a48k","1"],
22 | "cctvseHD"=>["6","a48k","1"],
23 | "cctv15HD"=>["6","a48k_zho","1"],
24 | "cctv16HD"=>["6","a48k_zho","1"],
25 | "cctv17HD"=>["6","a48k","2"],
26 | "CCTV4K"=>["15","a48k_zho","1"],
27 | "hxjc_4K"=>["15","a48k_zho","1"],
28 | "CCTV16_4K"=>["15","a48k_zho","1"],
29 | "jiangsuHD"=>["6","a48k_zho","1"],
30 | "beijingHD"=>["6","a48k","10"],
31 | "zhejiangHD"=>["6","a48k","5"],
32 | "shanghaiHD"=>["6","a48k","3"],
33 | "shenzhenHD"=>["6","a48k","4"],
34 | "liaoningHD"=>["6","a48k","6"],
35 | "tianjinHD"=>["6","a48k","4"],
36 | "guizhouHD"=>["6","a48k_zho","1"],
37 | "sichuanHD"=>["6","a48k","2"],
38 | "chongqingHD"=>["4","a48k","1"],
39 | "yunnanSD"=>["4","a48k","3"],
40 | "heilongjiangHD"=>["4","a48k","3"],
41 | "anhuiSD"=>["4","a48k","3"],
42 | "hebeiSD"=>["4","a48k","3"],
43 | "jiangxiHD"=>["4","a48k_zho","5"],
44 | "hubeiSD"=>["4","a48k","3"],
45 | "hainanSD"=>["4","a48k","3"],
46 | "dongnanHD"=>["4","a48k","3"],
47 | "jilinHD"=>["6","a48k","4"],
48 | "guangxiHD"=>["6","a48k_zho","1"],
49 | "neimengkuSD"=>["2","a48k","3"],
50 | "hunanHD"=>["6","a48k","4"],
51 | "guangdongHD"=>["6","a48k","2"],
52 | "henanHD"=>["6","a48k","1"],
53 | "shanxiSD"=>["2","a48k","1"],
54 | "bingtuanSD"=>["2","a48k","1"],
55 | "ningxia"=>["2","a48k_zho","1"],
56 | "bjkakuSD"=>["2","a48k","1"],
57 | "jinyingSD"=>["6","a48k","2"],
58 | "sanshaSD"=>["2","a48k","1"],
59 | "qinghaiSD"=>["2","a48k","1"],
60 | "tianqiSD"=>["2","a48k","1"],
61 | "bjayjsSD"=>["6","a48k","1"],
62 | "sdjiaoyuSD"=>["2","a48k","1"],
63 | "xinjiangSD"=>["2","a48k","1"],
64 | "xizangSD"=>["2","a48k","1"],
65 | "cgtnSD"=>["2","a48k","1"],
66 | "cetv-1SD"=>["2","a48k","1"],
67 | "cetv-4SD"=>["2","a48k","1"],
68 | "shenghuo"=>["2","a48k_zho","1"],
69 | "jiankangSD"=>["2","a48k","1"],
70 | "mryyHD"=>["6","a48k_zho","1"],
71 | "xfjcHD"=>["6","a48k_zho","1"],
72 | "klcdHD"=>["6","a48k_zho","1"],
73 | "diyijuchangHD"=>["4","a48k","2"],
74 | "dsjcHD"=>["6","a48k_zho","1"],
75 | "dmxcHD"=>["6","a48k_zho","1"],
76 | "mlzqHD"=>["6","a48k_zho","1"],
77 | "fyjcHD"=>["6","a48k_zho","1"],
78 | "qsjlHD"=>["6","a48k_zho","1"],
79 | "bqkjHD"=>["6","a48k_zho","1"],
80 | "yxfyHD"=>["6","a48k_zho","1"],
81 | "chcgqdyHD"=>["6","a48k_zho","1"],
82 | "chcjtyyHD"=>["6","a48k_zho","1"],
83 | "chcdzdyHD"=>["6","a48k_zho","1"],
84 | "xfylHD"=>["6","a48k_zho","1"],
85 | "fsshHD"=>["6","a48k_zho","1"],
86 | "hjjcHD"=>["6","a48k_zho","1"],
87 | "fyyyHD"=>["6","a48k_zho","1"],
88 | "ystqHD"=>["6","a48k_zho","1"],
89 | "fyzqHD"=>["6","a48k_zho","1"],
90 | "yswhHD"=>["6","a48k_zho","1"],
91 | "golfHD"=>["6","a48k_zho","1"],
92 | "zaojiaoHD"=>["6","a48k_zho","1"],
93 | "dfcj"=>["2","a48k_zho","1"],
94 | "jiazheng"=>["2","a48k_zho","1"],
95 | "shuhua"=>["2","a48k_zho","1"],
96 | "dongman"=>["2","a48k_zho","1"],
97 | "guoxue"=>["2","a48k_zho","1"],
98 | "youxi"=>["2","a48k_zho","1"],
99 | "techan"=>["2","a48k_zho","1"],
100 | "car"=>["2","a48k_zho","1"],
101 | "shengtai"=>["2","a48k_zho","1"],
102 | "diaoyu"=>["2","a48k_zho","1"],
103 | "faxian"=>["2","a48k_zho","1"],
104 | "doxtv"=>["2","a48k_zho","1"],
105 | "fazhi"=>["2","a48k_zho","1"],
106 | "jinse"=>["2","a48k_zho","1"],
107 | "soucang"=>["2","a48k_zho","1"],
108 | "caifu"=>["2","a48k_zho","1"],
109 | "nvxing"=>["2","a48k_zho","1"],
110 | "qicai"=>["2","a48k_zho","1"],
111 | "weiqi"=>["2","a48k_zho","1"],
112 | "xianfeng"=>["2","a48k_zho","1"],
113 | "huanqiulvyou"=>["2","a48k","1"],
114 | "gushi"=>["2","a48k_zho","1"],
115 | "sheying"=>["2","a48k_zho","1"],
116 | "CQTVNewsHD"=>["4","a48k","1"],
117 | "cqyingshiHD"=>["6","a48k","1"],
118 | "CQTVTrendyHD"=>["6","a48k","1"],
119 | "cqssgwHD"=>["6","a48k","1"],
120 | "cqwtylHD"=>["6","a48k","1"],
121 | "cqggncHD"=>["6","a48k","1"],
122 | "cqseHD"=>["6","a48k","1"],
123 | "CQTVkejiaoHD"=>["6","a48k_zho","1"],
124 | "cqcarSD"=>["2","a48k","1"],
125 | "aikanHD"=>["6","a48k_zho","2"],
126 | "changshou"=>["2","a48k","1"],
127 | "youyang"=>["2","a48k","2"],
128 | "cqrongmei"=>["2","a48k","1"],
129 |
130 | ];
131 | $req = basename(parse_url($_SERVER['REQUEST_URI'])["path"]); // 这里可以选择写死文件名 如: cqyx_q.php
132 | $id = $_GET['id']?:'cctv1HD';
133 | $type = $_GET['type']?:'playlist'; // audio // video
134 | $seq = $_GET['seq']?:intval(time()/10)-1080;
135 | $content = "#EXTM3U\n";
136 | if($type == 'playlist')
137 | {
138 | $content.= "#EXT-X-VERSION:4\n#EXT-X-INDEPENDENT-SEGMENTS\n";
139 | $content.= "#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=\"cqyxaudio\",DEFAULT=YES,URI=\"{$req}?id={$id}&type=audio&seq={$seq}\"\n";
140 | $content.= "#EXT-X-STREAM-INF:BANDWIDTH=".strval($ids[$id][0]*1024*1024).",AUDIO=\"cqyxaudio\"\n";
141 | $content.= "{$req}?id={$id}&type=video&seq={$seq}\n";
142 | }
143 | else
144 | {
145 | $content.= "#EXT-X-VERSION:3\n#EXT-X-MEDIA-SEQUENCE:{$seq}\n#EXT-X-TARGETDURATION:11\n";
146 | $path = $ids[$id][2]."/".($type=="audio"?$ids[$id][1]:"v".$ids[$id][0]."M");
147 | for($i=0;$i<6;$i++) // 切片数量你酌情修改,此处定义数量为 6
148 | {
149 |
150 | $content .= "#EXTINF:10.000,\n";
151 | $content .= "http://hls.live.cqccn.com/__cl/cg:live/__c/{$id}/__op/default/__f/{$path}/".strval($seq+$i).".ts\n";
152 | }
153 | }
154 |
155 | header("Content-Type: application/vnd.apple.mpegURL");
156 | header("Content-Disposition: filename={$id}.m3u8");
157 | echo $content;
158 |
159 | ?>
160 |
--------------------------------------------------------------------------------
/dxxw.php:
--------------------------------------------------------------------------------
1 | random;
29 | $pubkey = $json->publicKey;
30 | $pubkey = "-----BEGIN PUBLIC KEY-----\n".wordwrap($pubkey,64,"\n",true)."\n-----END PUBLIC KEY-----";
31 |
32 | $bstrURL = "https://pubmod.hntv.tv/program/getAuth/clientlive/getClientLiveByClassId";
33 | $data = "classId=11";
34 | openssl_public_encrypt($data,$enc_data,$pubkey);
35 |
36 | $data = [
37 | "version"=> "version.0.0.1",
38 | "random"=> $rnd,
39 | "data"=> base64_encode($enc_data)
40 | ];
41 |
42 | $headers[] = 'Content-Type: application/json';
43 |
44 | $ch = curl_init();
45 | curl_setopt($ch, CURLOPT_URL, $bstrURL);
46 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
47 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
48 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
49 | curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
50 | curl_setopt($ch, CURLOPT_POST,TRUE);
51 | curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($data));
52 | $data = curl_exec($ch);
53 | curl_close($ch);
54 | $json = json_decode($data);
55 | $playURL = "";
56 | foreach($json as $lst)
57 | {
58 | if($lst->cid == $id)
59 | {
60 | $playURL = $lst->video_streams[0];
61 | break;
62 | }
63 | }
64 |
65 | header("location:".$playURL);
66 |
67 |
68 | /// 频道编码 ///
69 | // 145 河南卫视
70 | // 141 都市频道
71 | // 146 民生频道
72 | // 147 法治频道
73 | // 148 电视剧频道
74 | // 149 新闻频道
75 | // 150 欢腾购物
76 | // 151 公共频道
77 | // 152 河南乡村频道
78 | // 153 河南国际
79 | // 154 梨园频道
80 | // 155 文物宝库
81 | // 156 武术频道
82 | // 157 睛彩中原
83 | // 163 移动戏曲频道
84 |
85 | ?>
86 |
--------------------------------------------------------------------------------
/dylive.php:
--------------------------------------------------------------------------------
1 | data->room->stream_url->hls_pull_url_map->FULL_HD1;
16 | header('location:'.$playURL);
17 |
18 | ?>
19 |
--------------------------------------------------------------------------------
/gdtv.php:
--------------------------------------------------------------------------------
1 | get("gdtv_".$id."_cache");
27 | if(!$playURL)
28 | {
29 |
30 | $ts = time().'790';
31 | $headers = [
32 | "content-type: application/json",
33 | "referer: https://www.gdtv.cn/",
34 | "origin: https://www.gdtv.cn",
35 | "user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36",
36 | "x-itouchtv-ca-key: 89541443007807288657755311869534",
37 | "x-itouchtv-ca-timestamp: $ts",
38 | "x-itouchtv-client: WEB_PC",
39 | "x-itouchtv-device-id: WEB_".createNewGUID(),
40 | ];
41 |
42 |
43 | $bstrURL = "https://tcdn-api.itouchtv.cn/getParam";
44 | $sign = base64_encode(hash_hmac("SHA256","GET\n$bstrURL\n$ts\n","dfkcY1c3sfuw0Cii9DWjOUO3iQy2hqlDxyvDXd1oVMxwYAJSgeB6phO8eW1dfuwX",true));
45 | $headers[] = "x-itouchtv-ca-signature: $sign";
46 |
47 |
48 |
49 | $ch = curl_init();
50 | curl_setopt($ch, CURLOPT_URL, $bstrURL);
51 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
52 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
53 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
54 | curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
55 | $data = curl_exec($ch);
56 | curl_close($ch);
57 | $json = json_decode($data);
58 |
59 | $node = $json->node;
60 |
61 | // 进入wss取串
62 |
63 | $contextOptions = [
64 | 'ssl' => [
65 | "verify_peer"=>false,
66 | "verify_peer_name"=>false,
67 | ]
68 | ];
69 | $context = stream_context_create($contextOptions);
70 | $sock = stream_socket_client("ssl://tcdn-ws.itouchtv.cn:3800",$errno,$errstr,1,STREAM_CLIENT_CONNECT,$context);
71 | stream_set_timeout($sock,1);
72 | if (!$sock) {
73 | die("Socket ERROR: $errno/$errstr
\n");
74 | } else {
75 | $wssData = [
76 | 'route'=>'getwsparam',
77 | 'message'=>$node
78 | ];
79 | $wssData = json_encode($wssData);
80 |
81 | $key = genSecKey();
82 | $header = "GET /connect HTTP/1.1\r\n";
83 | $header.= "Host: tcdn-ws.itouchtv.cn:3800\r\n";
84 | $header.= "Connection: Upgrade\r\n";
85 | $header.= "Cache-Control: no-cache\r\n";
86 | $header.= "Upgrade: websocket\r\n";
87 | $header.= "Origin: https://www.gdtv.cn\r\n";
88 | $header.= "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36\r\n";
89 | $header.= "Sec-WebSocket-Version: 13\r\n";
90 | $header.= "Sec-WebSocket-Key: {$key}\r\n";
91 | $header.= "Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\r\n";
92 |
93 | fwrite($sock,$header."\r\n");
94 |
95 | $handshake = stream_get_contents($sock);
96 |
97 | if(strstr($handshake,'Sec-Websocket-Accept'))
98 | {
99 | fwrite($sock, encode($wssData));
100 | $param = stream_get_contents($sock);
101 | $param = substr($param,4);
102 | $json =json_decode($param);
103 | $wsnode = $json->wsnode;
104 |
105 | }
106 |
107 | }
108 |
109 | // wss 取串结束.
110 |
111 | // 先options告知服务器我要干嘛 //
112 | // 不知道这里是否有有效时间问题,一次options成功后边都不需要提交 ? 待测试 //
113 |
114 | $bstrURL = "https://gdtv-api.gdtv.cn/api/tv/v2/tvChannel/$id?tvChannelPk=$id&node=".base64_encode($wsnode);
115 | $sign = base64_encode(hash_hmac("SHA256","GET\n$bstrURL\n$ts\n","dfkcY1c3sfuw0Cii9DWjOUO3iQy2hqlDxyvDXd1oVMxwYAJSgeB6phO8eW1dfuwX",true));
116 |
117 | $opt_headers = [
118 | "access-control-request-headers: content-type,x-itouchtv-ca-key,x-itouchtv-ca-signature,x-itouchtv-ca-timestamp,x-itouchtv-client,x-itouchtv-device-id",
119 | "access-control-request-method: GET",
120 | "origin: https://www.gdtv.cn",
121 | "referer: https://www.gdtv.cn",
122 | "user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36",
123 |
124 | ];
125 |
126 |
127 | $ch = curl_init();
128 | curl_setopt($ch, CURLOPT_URL, $bstrURL);
129 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "OPTIONS");
130 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
131 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
132 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
133 | curl_setopt($ch, CURLOPT_HTTPHEADER,$opt_headers);
134 | $data = curl_exec($ch);
135 | curl_close($ch);
136 |
137 | array_pop($headers);
138 | $headers[] = "x-itouchtv-ca-signature: $sign";
139 |
140 | $ch = curl_init();
141 | curl_setopt($ch, CURLOPT_URL, $bstrURL);
142 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
143 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
144 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
145 | curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
146 | $data = curl_exec($ch);
147 |
148 | curl_close($ch);
149 | $json = json_decode($data);
150 | $playURL = json_decode($json->playUrl)->hd;
151 | $cache->put("gdtv_".$id."_cache",$playURL);
152 | fclose($sock); // 取串完成再关闭wss
153 | }
154 | // m3u8清单有referer校验。
155 | $ch = curl_init();
156 | curl_setopt($ch, CURLOPT_URL, $playURL);
157 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
158 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
159 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
160 | curl_setopt($ch, CURLOPT_HTTPHEADER,["Referer: https://www.gdtv.cn","origin: https://www.gdtv.cn"]);
161 | $data = curl_exec($ch);
162 | curl_close($ch);
163 |
164 | header("Content-Type: application/vnd.apple.mpegURL");
165 | header("Content-Disposition: filename=$id.m3u8");
166 | echo $data;
167 |
168 |
169 | function genSecKey()
170 | {
171 | return base64_encode(substr(md5(mt_rand(1,999)),0,16));
172 | }
173 |
174 | function encode($data)
175 | {
176 | // 本处代码偷懒了,仅限该解析代码使用。
177 | $len = strlen($data);
178 | $head[0] = 129;
179 | $mask = [];
180 | for ($j = 0; $j < 4; $j ++)
181 | {
182 | $mask[] = mt_rand(1, 128);
183 | }
184 | $split = str_split(sprintf('%016b', $len), 8);
185 | $head[1] = 254;
186 | $head[2] = bindec($split[0]);
187 | $head[3] = bindec($split[1]);
188 | $head = array_merge($head, $mask);
189 | foreach ($head as $k => $v)
190 | {
191 | $head[$k] = chr($v);
192 | }
193 | $mask_data = '';
194 | for ($j = 0; $j < $len; $j ++)
195 | {
196 | $mask_data .= chr(ord($data[$j]) ^ $mask[$j % 4]);
197 |
198 | }
199 | return implode('', $head).$mask_data;
200 |
201 | }
202 | function createNewGUID()
203 | {
204 | if (function_exists('com_create_guid') === true)
205 | {
206 | return trim(com_create_guid(), '{}');
207 | }
208 | return 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));
209 | }
210 |
211 |
212 | // 以下缓存类来自互联网,请确保cache目录存在以及读写权限 //
213 | class Cache {
214 |
215 | private $cache_path;
216 | private $cache_expire;
217 | public function __construct($exp_time=3600,$path="cache/"){
218 | $this->cache_expire=$exp_time;
219 | $this->cache_path=$path;
220 | }
221 |
222 | private function fileName($key){ return $this->cache_path.md5($key); }
223 | public function put($key, $data){
224 |
225 | $values = serialize($data);
226 | $filename = $this->fileName($key);
227 | $file = fopen($filename, 'w');
228 | if ($file){
229 |
230 | fwrite($file, $values);
231 | fclose($file);
232 | }
233 | else return false;
234 | }
235 |
236 | public function get($key){
237 |
238 | $filename = $this->fileName($key);
239 |
240 | if (!file_exists($filename) || !is_readable($filename)){ return false; }
241 |
242 | if ( time() < (filemtime($filename) + $this->cache_expire) ) {
243 |
244 | $file = fopen($filename, "r");
245 |
246 | if ($file){
247 |
248 | $data = fread($file, filesize($filename));
249 | fclose($file);
250 | return unserialize($data);
251 | }
252 | else return false;
253 |
254 | }
255 | else return false;
256 | }
257 | }
258 |
259 |
260 |
261 |
262 | ?>
263 |
--------------------------------------------------------------------------------
/huya.php:
--------------------------------------------------------------------------------
1 | data->stream->baseSteamInfoList[0]; // 获取stream信息
18 | // 组装播放地址
19 | $sStreamName = $bStreamLst->sStreamName;
20 | $sAntiCode = $bStreamLst->sHlsAntiCode;
21 |
22 | $sCdnType = strtolower($json->data->stream->hls->multiLine[0]->cdnType);
23 | $sHlsUrl = "https://".(($cdnType=='')?$sCdnType:$cdnType).".hls.huya.com/src/";
24 |
25 | parse_str($sAntiCode,$params);
26 | $fm = base64_decode($params['fm']);
27 | $wsTime = $params['wsTime'];
28 |
29 | $msTime = time().'212';//13位时间戳;
30 | $seqid = big_integer_add($uid,$msTime);
31 |
32 | $t = 103;
33 | $ctype = 'tars_mobile';
34 |
35 | $i = md5($seqid.'|'.$ctype.'|'.$t);
36 |
37 | $wsSecret = md5(str_replace(['$0','$1','$2','$3'],[$uid,$sStreamName,$i,$wsTime],$fm)); // uid_streamname_hash_wstime
38 |
39 | $uuid = Kmod(substr($msTime,3,10).'212',4294967295);// % 4294967295;
40 |
41 | $sPlayUrl = $sHlsUrl.$sStreamName.'.m3u8?wsSecret='.$wsSecret.'&wsTime='.$wsTime.'&uuid='.$uuid.'&uid='.$uid.'&txyp=o%253Ad2%253B&fs=bgct&sphdcdn=al_7-tx_3-js_3-ws_7-bd_2-hw_2&sphdDC=huya&sphd=264_*-265_*&ctype='.$ctype.'&seqid='.$seqid.'&ver=1&t='.$t.'&sv=2110211124';
42 |
43 | header("location:".$sPlayUrl);
44 |
45 | function big_integer_add($num1,$num2) // 32位PHP大数加法
46 | {
47 | $str1 = strval($num1);
48 | $str2 = strval($num2);
49 | $len2 = strlen($str1);
50 | $len3 = strlen($str2);
51 | $len = $len2>$len3?$len2:$len3;
52 | $result = '';
53 | $flag = 0;
54 | while($len--){
55 | $m = 0;
56 | $n = 0;
57 | if($len2>0)
58 | $m = $str1[--$len2];
59 | if($len3>0)
60 | $n = $str2[--$len3];
61 | $tmp = $m+$n+$flag;
62 | $flag = $tmp/10;
63 | $result = ($tmp%10).$result;
64 | }
65 | return $result;
66 | }
67 |
68 |
69 | function Kmod($n1, $n2) // 32位PHP大数取余
70 | {
71 | return intval(fmod(floatval($n1), $n2));
72 | }
73 | ?>
74 |
--------------------------------------------------------------------------------
/pptv.php:
--------------------------------------------------------------------------------
1 | childNodes);
30 | $json = $json->childNodes[$dwLen-5];
31 | $rid = str_replace(".mp4",".m3u8", $json->rid);
32 | $host = $json->childNodes[0]->childNodes[0];
33 | $k = str_replace('&bppcataid=1','',urldecode($json->childNodes[5]->childNodes[0]));
34 |
35 | $playUrl = "http://{$host}/{$rid}?h5vod.ver=2.1.4&k={$k}&type=mhpptv&sv=4.1.16";
36 | header("location:{$playUrl}");
37 | ?>
38 |
--------------------------------------------------------------------------------
/sh5gtv.php:
--------------------------------------------------------------------------------
1 | clientID;
52 | }
53 |
54 | $playApiKey = "557f1d838112de4fc349b8558781fe17";
55 | $id = $_GET['id']; // 欢笑剧场id = 47
56 | $bstrURL = "https://kylinapi.bbtv.cn/bestvapi/tv/now/{$id}?client=".getClientID(); // 这里的ClientID可以长期使用,建议看上边
57 | //$bstrURL = "https://kylinapi.bbtv.cn/bestvapi/tv/now/{$id}?client=X18L20Z0O5CGZySIjGDwEw%3D%3D"; // ClientID可用。
58 | $ts = time();
59 | // 目前 没有强制的Header校验,可要可不要。
60 | $headers = [
61 | 'timestamp: '.$ts,
62 | 'sign: '.md5($ts.$playApiKey)
63 | ];
64 |
65 | $ch = curl_init();
66 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
67 | curl_setopt($ch, CURLOPT_URL, $bstrURL);
68 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
69 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
70 | curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
71 | $data = curl_exec($ch);
72 | curl_close($ch);
73 | $json = json_decode($data);
74 | $playURL = $json->playUrl;
75 | header("location:{$playURL}");
76 |
77 |
78 | ?>
79 |
--------------------------------------------------------------------------------
/touchtv.php:
--------------------------------------------------------------------------------
1 | node;
29 |
30 | array_pop($headers);
31 | $bstrURL = "https://api.itouchtv.cn/liveservice/v3/tvChannelList?node=$node";
32 | $sign = base64_encode(hash_hmac("SHA256","GET\n$bstrURL\n$ts\n","qmiHeB9bKgowHqxRv0prc2cPN2EwXL1HOYu3DPiYCcaYxyxdFIyT5mAfBmr0UKPO",true));
33 | $headers[] = "X-ITOUCHTV-Ca-Signature:$sign";
34 |
35 | $ch = curl_init();
36 | curl_setopt($ch, CURLOPT_URL, $bstrURL);
37 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
38 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
39 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
40 | curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
41 | $data = curl_exec($ch);
42 | curl_close($ch);
43 |
44 | if($pk == '')
45 | {
46 | $json = json_decode($data);
47 | foreach($json->tvChannelList as $out)
48 | {
49 | echo ($out->name.','.$out->pk.'
');
50 | }
51 | }
52 | else
53 | {
54 | preg_match('/pk":'.$pk.',.*?"url":"(.*?)"/i',$data,$result);
55 | $playURL = $result[1];
56 | header("location:$playURL");
57 | }
58 | ?>
59 |
--------------------------------------------------------------------------------
/vvvdj.php:
--------------------------------------------------------------------------------
1 | 0 ? a.substring(0, b) : null;
7 | },
8 | this.substring_b = function(a, b) {
9 | return a.length - b >= 0 && a.length >= 0 && a.length - b <= a.length ? a.substring(a.length - b, a.length) : null;
10 | },
11 | this.decode_b = function(a, b) {
12 | var c, d, e, f, g, h, i, j, k = "";
13 | for (c = 0; c < b.length; c++) {
14 | k += b.charCodeAt(c).toString(); // O0000OO0OO00O 逐字符取CODE // O = 79 0 = 48 79484848487979487979484879
15 | }
16 | // d = 5 //d = Math.floor(k.length / 5)
17 | // e = 8 + 7 + 8 + 4 + 9
18 | // e = parseInt(k.charAt(d) + k.charAt(2 * d) + k.charAt(3 * d) + k.charAt(4 * d) + k.charAt(5 * d))
19 | // f = 8
20 | // g = 2147483647
21 | // h = 72115018
22 | // a = "a9ab"
23 | // k+=h = 7948484848797948797948487972115018
24 | for (d = Math.floor(k.length / 5), e = parseInt(k.charAt(d) + k.charAt(2 * d) + k.charAt(3 * d) + k.charAt(4 * d) + k.charAt(5 * d)), f = Math.round(b.length / 2), g = Math.pow(2, 31) - 1, h = parseInt(a.substring(a.length - 8, a.length), 16), a = a.substring(0, a.length - 8), k += h; k.length > 10;) {
25 | k = (parseInt(k.substring(0, 10)) + parseInt(k.substring(10, k.length))).toString();
26 | }
27 | // k = 948503
28 | // k = 36*948503+8 = 34146116 % 2147483647 = 34146116
29 | //
30 | for (k = (e * k + f) % g, i = "", j = "", c = 0; c < a.length; c += 2) {
31 | i = parseInt(parseInt(a.substring(c, c + 2), 16) ^ Math.floor(255 * (k / g))),
32 | j += String.fromCharCode(i),
33 | k = (e * k + f) % g;
34 | }
35 | return j; // e0 你花里胡哨的就为了把 e0 加密 ??
36 | },
37 | this.substring_c = function(a, b, c) {
38 | return a.length >= 0 ? a.substr(b, c) : null;
39 | },
40 | this.string_len = function(a) {
41 | return a.length;
42 | },
43 | this.decoded = function(a, b) {
44 | var h, i, j, k, l, m, n, o, p, c = b,
45 | d = this.string_len(c),
46 | e = d,
47 | f = new Array(),
48 | g = new Array();
49 | for (l = 1; d >= l; l++) {
50 | f[l] = this.substring_c(c, l - 1, 1).charCodeAt(0),
51 | g[e] = f[l],
52 | e -= 1;
53 | }
54 | for (h = "", i = a, m = this.substring_s(i, 2), i = this.substring_b(i, this.string_len(i) - 2), l = 0; l < this.string_len(i); l += 4) {
55 | j = this.substring_c(i, l, 4),
56 | "" != j && (b = this.substring_s(j, 1), k = (parseInt(this.substring_b(j, 3)) - 100) / 3, m == this.decode_b("a9ab044c634a", "O0000OO0OO00O") ? (n = 2 * parseInt(b.charCodeAt(0)), o = parseInt(f[k]), p = n - o, h += String.fromCharCode(p)) : (n = 2 * parseInt(b.charCodeAt(0)), o = parseInt(g[k]), p = n - o, h += String.fromCharCode(p)));
57 | }
58 | return h;
59 | };
60 | }
61 | function playurl(pj, pj1) {
62 | var x = new DeCode();
63 | playurl = x.decoded(pj, pj1);
64 | return playurl;
65 | }
66 |
67 | */
68 | // --------------------------------------- 分割线 ------------------------------------
69 | // vvvdj decoded
70 | $bstrURL = "https://www.vvvdj.com/play/224863.html";
71 | $ch = curl_init();
72 | curl_setopt($ch, CURLOPT_URL, $bstrURL);
73 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
74 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
75 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
76 | $data = curl_exec($ch);
77 | curl_close($ch);
78 | preg_match("/playurl=x.O000O0OO0O0OO\('(.*?)','(.*?)'\);/i",$data,$ma);
79 |
80 |
81 | $a = $ma[1];
82 | $b = $ma[2];
83 |
84 | $d = strlen($b);
85 | $f = [];
86 | $g = [];
87 | for($l = 1;$l<=$d;$l++)
88 | {
89 | $f[$l] = ord(substr($b,$l-1,1));
90 | }
91 | $g = array_reverse($f);
92 |
93 | $m = substr($a,0,2);
94 | $i = substr($a,2);
95 |
96 | for($l=0;$l
127 |
--------------------------------------------------------------------------------
/xwlj.php:
--------------------------------------------------------------------------------
1 | 0,
25 | "phone"=>"你的手机号码",
26 | "password"=>"你的明文密码",
27 | ];
28 | $headers = [
29 | 'Content-Type: application/json',
30 | ];
31 | $ch = curl_init();
32 | curl_setopt($ch, CURLOPT_URL,$bstrURL);
33 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
34 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
35 | curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
36 | curl_setopt($ch, CURLOPT_POST,true);
37 | curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($params));
38 | curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
39 | $data = curl_exec($ch);
40 | curl_close($ch);
41 | $json = json_decode($data);
42 | $auth = $json->data->Authorization; // 建议缓存,有效期7天
43 |
44 | $id = $_GET['id']; // 2=新闻 1= 经济
45 |
46 | $bstrURL = "http://api-cms.xishuirm.com/v1/mobile/channel/play_auth?stream=https:%2F%2Fali-live.xishuirm.com%2Flive%2Fapp{$id}.m3u8";
47 | $ch = curl_init();
48 | curl_setopt($ch, CURLOPT_URL,$bstrURL);
49 | curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
50 | curl_setopt($ch, CURLOPT_HTTPHEADER,['Authorization: '.$auth]);
51 | $data = curl_exec($ch);
52 | curl_close($ch);
53 | $json = json_decode($data);
54 | $auth_key = $json->data->auth_key;
55 |
56 | $bstrURL = "https://ali-live.xishuirm.com/live/app{$id}.m3u8?auth_key={$auth_key}";
57 | $ch = curl_init();
58 | curl_setopt($ch, CURLOPT_URL,$bstrURL);
59 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
60 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
61 | curl_setopt($ch, CURLOPT_HTTPHEADER,['Referer: http://www.xishuirm.com']);
62 | curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
63 | $data = curl_exec($ch);
64 | curl_close($ch);
65 |
66 | header("Content-Type: application/vnd.apple.mpegURL");
67 | header("Content-Disposition: filename=$id.m3u8");
68 | echo preg_replace('/(.*?.ts)/i',"xwlj.php?ts=$1",$data);
69 |
70 |
71 | ?>
72 |
--------------------------------------------------------------------------------
/yspweb.php:
--------------------------------------------------------------------------------
1 | 2147483648) ? $xl - 4294967296 : $xl; // 吊毛 64位PHP
28 |
29 | $el = '|'.$xl.$el;
30 | $ckey = "--01".strtoupper(bin2hex(openssl_encrypt($el,"AES-128-CBC",$key,1,$iv)));
31 |
32 | $params = [
33 | "adjust"=>1,
34 | "appVer"=>"V1.0.0",
35 | "app_version"=>"V1.0.0",
36 | "cKey"=>$ckey,
37 | "channel"=>"ysp_tx",
38 | "cmd"=>"2",
39 | "cnlid"=>$cnlid,
40 | "defn"=>"fhd",
41 | "devid"=>"devid",
42 | "dtype"=>"1",
43 | "encryptVer"=>"8.1",
44 | "guid"=>$guid,
45 | "livepid"=>$pid,
46 | "otype"=>"ojson",
47 | "platform"=>$platform,
48 | "rand_str"=>rand_str(), // 此处为10位大小写随机字符
49 | "sphttps"=>"1",
50 | "stream"=>"2"
51 | ];
52 |
53 |
54 | $sign = md5(http_build_query($params).$salt);
55 | $params["signature"] = $sign;
56 |
57 | $headers = [
58 |
59 | "Referer: https://www.yangshipin.cn/",
60 | "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
61 | "Cookie: guid={$guid}; versionName=99.99.99; versionCode=999999; vplatform=109; platformVersion=Chrome; deviceModel=122; uinfo_logintype=mobile; seqId=20; request-id=999999".rand_str().$ts."123",
62 | "Yspappid: 519748109",
63 |
64 | ];
65 |
66 | $authParm = "appid=ysp_pc&guid={$guid}&pid=0&rand_str=".rand_str();
67 | $authParm = $authParm."&signature=".md5($authParm."Q0uVOpuUpXTOUwRn");
68 | $bstrURL = "https://player-api.yangshipin.cn/v1/player/auth";
69 | $ch = curl_init();
70 | curl_setopt($ch, CURLOPT_URL, $bstrURL);
71 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
72 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
73 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
74 | curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
75 | curl_setopt($ch, CURLOPT_POST,true);
76 | curl_setopt($ch, CURLOPT_POSTFIELDS,$authParm);
77 | $data = curl_exec($ch);
78 | curl_close($ch);
79 | $json = json_decode($data);
80 |
81 | $ysptoken = $json->data->token;
82 | $headers[] = "Content-Type: application/json";
83 | $headers[] = "Yspplayertoken: {$ysptoken}";
84 |
85 |
86 | $bstrURL = "https://player-api.yangshipin.cn/v1/player/get_live_info";
87 | $ch = curl_init();
88 | curl_setopt($ch, CURLOPT_URL, $bstrURL);
89 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
90 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
91 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
92 | curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
93 | curl_setopt($ch, CURLOPT_POST,true);
94 | curl_setopt($ch, CURLOPT_POSTFIELDS,json_encode($params));
95 | $data = curl_exec($ch);
96 | curl_close($ch);
97 |
98 | $json = json_decode($data);
99 |
100 | $chanll = json_decode($json->data->chanll);
101 | $tmpcode = base64_decode($chanll->code);
102 | preg_match('/var des_key = "(.*?)"/',$tmpcode,$deskey);
103 | preg_match('/var des_iv = "(.*?)"/',$tmpcode,$desiv);
104 | $plain = '{"mver": "1","subver": "1.2","host": "www.yangshipin.cn/#/tv/home","referer": "","canvas": "YSPANGLE(Google,Vulkan1.3.0(SwiftShaderDevice(Subzero)(0x0000C0DE)),SwiftShaderdriver)"}';
105 |
106 | $revoi = openssl_encrypt($plain,"DES-EDE3-CBC",base64_decode($deskey[1]),1,base64_decode($desiv[1]));
107 | $revoi = strtoupper(bin2hex($revoi));
108 |
109 | if($json->data->iretcode == 0)
110 | {
111 | // 这里建议缓存
112 | $playurl = $json->data->playurl;
113 | $exinfo = $json->data->extended_param;
114 | header("location:".$playurl."&revoi=".$revoi.$exinfo);
115 | }
116 |
117 | function rand_str()
118 | {
119 | $e = "ABCDEFGHIJKlMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
120 | $i = 0;
121 | $str = "";
122 | while($i<10)
123 | {
124 | $str.= $e[mt_rand(0,61)];
125 | $i++;
126 | }
127 | return $str;
128 | }
129 |
130 |
131 | ?>
132 |
--------------------------------------------------------------------------------