xadssa commited on
Commit
a173968
·
1 Parent(s): 28f72a9

Update index.php

Browse files
Files changed (1) hide show
  1. index.php +15 -20
index.php CHANGED
@@ -1,21 +1,16 @@
1
  <?php
2
- date_default_timezone_set("Asia/Shanghai");
3
- $channel = empty($_GET['id']) ? "emdy4k_8000" : trim($_GET['id']);
4
- $array = explode("_", $channel);
5
- if (isset($array[1])) {
6
- $stream = "http://[240e:944:6::22]/live2.rxip.sc96655.com/live/8ne5i_sccn,{$array[0]}_hls_pull_{$array[1]}K/";
7
- } else {
8
- $stream = "http://[240e:944:6::22]/live2.rxip.sc96655.com/live/8ne5i_sccn,{$array[0]}_hls_pull_4000K/";
9
- }
10
- $timestamp = intval((time() - 60) / 6);
11
- $current = "#EXTM3U" . "\r\n";
12
- $current .= "#EXT-X-VERSION:3" . "\r\n";
13
- $current .= "#EXT-X-TARGETDURATION:6" . "\r\n";
14
- $current .= "#EXT-X-MEDIA-SEQUENCE:{$timestamp}" . "\r\n";
15
- for ($i = 0; $i < 6; $i++) {
16
- $current .= "#EXTINF:6," . "\r\n";
17
- $current .= $stream . rtrim(chunk_split($timestamp, 3, "/"), "/") . ".ts" . "\r\n";
18
- $timestamp = $timestamp + 1;
19
- }
20
- header("Content-Disposition: attachment; filename=index.m3u8");
21
- echo $current;
 
1
  <?php
2
+
3
+ //http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888888/224/3221225804/1.m3u8
4
+ $ou =isset($_GET['ou'])?$_GET['ou']:'2';
5
+ $cid = $_GET['id'];
6
+ $url = 'http://39.134.24.16'.$ou.'/dbiptv.sn.chinamobile.com/PLTV/88888888/224/322122'.$cid.'/1.m3u8';
7
+ $curl = curl_init();
8
+ curl_setopt($curl, CURLOPT_URL, $url);
9
+ curl_setopt($curl, CURLOPT_TIMEOUT, 2);
10
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
11
+ $data = curl_exec($curl);
12
+ curl_close($curl);
13
+ $data = preg_replace('/(\d+-\d+-\d+)(.hls.ts)/', 'http://39.134.24.16'.$ou.'/dbiptv.sn.chinamobile.com/PLTV/88888888/224/322122'.$cid.'/$1$2', $data);
14
+ echo $data;
15
+ header("Content-Disposition: attachment; filename=欧歌.m3u8");
16
+ ?>